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!
精彩评论