How To Recursively Delete Files And Directories Using Java
How can you recursively delete files and directories in windows? You can select them in explorer (in windows) and delete it, right?
The problem with the explorer approach is that if one or more files and / or directories cannot be deleted then the whole process fails. Try cleaning your Local Settings\temp directory to see an example. Most likely it will fail in windows explorer.
Also I have seen it fail when large number of files are selected. It is slow and not usable from command line.
(In Unix/linux the problem is much simpler - rm -rf *)
However for the moment let's see how we can simplify this on windows using a bit of java. I present with with a superfast method to delete multiple files and directories from command line recursively.
Download Delete.class
Usage:
java Delete [list of files and / or directories]
No warranties (express or implied) are provided. Use at your own risk. All deletion using this utility is final. It cannot be recovered from Recycle Bin (on windows).
Filed under Headline News, How To, Java Software, Linux, Microsoft, Tech Note, Windows |
|
RSS 2.0 |
Trackback this Article
|
Email this Article
You may also like to read |




































