Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 772
Viktorianec Avatar asked Dec 13 '25 05:12

Viktorianec


2 Answers

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

like image 152
Vijay Varadan Avatar answered Dec 14 '25 18:12

Vijay Varadan


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

like image 20
Antoni Sawicki Avatar answered Dec 14 '25 18:12

Antoni Sawicki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!