Win32 API P-Invoke to bring the disk online, offline and set a unique identifier

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?

+2
source share
2 answers

, Dispart, WMI, ​​. , - Windows.

Storage WMI Classes, - :
http://msdn.microsoft.com/en-us/library/ff567016%28VS.85%29.aspx

: , , .

0
0

All Articles