I work in C,C++ Windows platform. I am to write code to format a pendrive. I searched and found DeviceIOControl() that seemed to fulfill my purpose. But I cannot proceed any further. Plz help me in this regard.
Did you try this shell API SHFormatDrive . It is the simplest one.
There is not other documented API apart from SHFormatDrive(). Only drawback is it is interactive.
If you do not want user to interact and you are targetting Wk3 you can use WMI classes
see this. You can find a C++ example as well there.
I have seen that API. But I have been told not to use that and do the entire coding by myself. I used CreateFile() and have got the disk handle. But I frnkly cannot make out what to do with the handle now.PLz do suggest some alternatives...
Formatting a drive is not a small task if you do not want to use WMI and shell APIs.
You will have to understand the basics of NTFS or FAT(which ever you select).
There are tons of resources on Internet. However, is is not an atomic task...