I want to make 2 partitions in usb flash drive. How can a usb can be partitioned using c++, even if all partitions are not shown in windows OS.
Printable View
I want to make 2 partitions in usb flash drive. How can a usb can be partitioned using c++, even if all partitions are not shown in windows OS.
For dealing with partitions I would suggest you look at some of the free software available rather than trying to write your own. I use Minitool Partition Wizard http://www.partitionwizard.com/
I need code in c++ please
In Windows there is the DeviceIoControl() function (http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx). The Disk Management Control codes (http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx) include codes to get partition info and to set partition info (http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx).
if you mean a memory stick. then those aren't partitioned, there's no provision for them to be partitioned. You could, in theory, design your own driver for a memory stick and do whatever you want, but it wouldn't be compatible with anything else.
If you mean a USB based harddisk or SSD, then that's just normal disk partitioning whether it's USB or SATA or SAS or whatever system driving the drive.
You can access that from C++ but you'd still have to do a lot of the low level stuff on your own. This would be your entrypoint for creating something like this;
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx