I am trying to create a bootable partition in Windows. I need to be able to do this from Windows XP through Windows 7. Ideally I would be able to do it both for FAT32 and NTFS depending on if the device is smaller than 32 GB (FAT32) or larger (NTFS).
On Vista and 7 I have a script that can do this using diskpart.exe, but this does not work on Windows XP because creating a partition is not exposed in diskpart.exe. The other problem with Windows XP diskpart is that usb thumb drives are not usually listed as drives (presumably because they're 'removable').
So my main need is, can I use DeviceIoControl or some other API to create a bootable partition, and have this method work from Windows XP to Windows 7? If I absolutely have to have different solutions for Pre-Vista and Vista+ that is ok.
Thank you.
Ben
You should be able to do this using IOCTL_DISK_CREATE_DISK with the CREATE_DISK parameters set to indicate MBR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With