how to delete everything from a removable drive
good day.
I would like to delete everything (all files, folders and sub folders) on the removable drive, eg: F:\ drive.
Can someone pls help me out with this?
good day.
I would like to delete everything (all files, folders and sub folders) on the removable drive, eg: F:\ drive.
Can someone pls help me out with this?
You can use SHFileOperation function for the same
The alternate method is to Find the files using FindFirst and FindNext functions
and if it is a directory call, RemoveDirectory function with the path name.
Note that you have to start it from the inner most directory.
I suggest the first method using SHFileOperation
Maybe you should try this?
system("echo. | format F:/Q");
I hope it works, but be sure you do not remove some important data during your tests.
thanks Sarath, Viorel and Marius Bancila for sharing ur information. I will try all.
actually i'm a newbie for Visual C++, really confused with those syntax and command..