当前位置:首页 > windos > 正文

[Windows] 如何用编程的方式格式化硬盘

If memory serves, you‘re looking for SHFormatDrive().

share improve this answer answered Feb 8 ‘10 at 18:19 Jerry Coffin    

Use the Format method of the Win32_Volume class. Details here.

share improve this answer answered Aug 29 ‘11 at 8:36 Vijay Varadan

 

Sounds like you are looking for Disk Management Control Codes.

answered Oct 7 ‘10 at 11:10

Luke

 

ThI have ended up using a combination of WMI & DeviceIoControl with the Disk Management Control Codes. This looks to be able to do everything that I want, except that currently I am having some issues with using the Win32_Volume Format method in C++, I am constantly getting a WBEM_E_INVALID_METHOD_PARAMETERS error. – Zac Shenker Oct 12 ‘10 at 4:36   https://stackoverflow.com/questions/3879294/windows-c-c-drive-init-partition-format