If memory serves, you're looking for SHFormatDrive()
.
Sounds like you are looking for .
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. – Oct 12 '10 at 4:36
https://stackoverflow.com/questions/3879294/windows-c-c-drive-init-partition-format