I am currently using Diskpart to perform these functions, but I would like to be able to use P-Invoke and not have a shell for an external process in my C # application.
Diskpart script examples:
//Online a disk
Select disk 7
disk online
// Reset GPT Identifier
select disk 7
UNIQUEID DISK ID=baf784e7-6bbd-4cfb-aaac-e86c96e166ee
I tried pinvoke.net search, but could only find functions that processed volumes, not disks. Any idea on how to execute these diskpart commands using Pinvoke?
source
share