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?

[177 byte] By [jwmoon] at [2007-12-24]
# 1

You can use SHFileOperation function for the same

Please

see the documentation

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

Sarath. at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 2

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.

Viorel. at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 3
Also see this code sample for check disk and format disk from Mark Russinovich.
MariusBancila at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 4

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..

jwcoffee at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 5
Formatting and deleting is quite different and it is less effient to remove the files and this is also spawning a console subsystem in our application. this is not a good way I think
Sarath. at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ Language...