开发者

How I could to run formatting disk programmatically? [duplicate]

This question already has answers here: Format drive by c++ 开发者_如何学Python (5 answers) Closed 9 years ago.

I search variants to format hard or usb disks programmatically. I founded api-function SHFormatDrive, but here use windows-dialog. To my mind, this method not bad, but how i could to hide/forbid this dialog. Anywhere, i continue search a way to format disks programmatically.


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


The correct way of doing it is to use Virtual Disk Service FormatPartition method.


On Windows systems, you can do a "silent" format by using ::CreateProcess() to execute a DOS format command.

See these 2 links for details. CreateProcess() API: http://www.codeproject.com/KB/cpp/9505Yamaha_1.aspx DOS format command: http://answers.yahoo.com/question/index?qid=20070712051040AAIny5w

Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜