Recursively delete files in Windows

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: Windows  

The del command allows recursive removal of specified files.


To delete all files ending in .tmp in the current directory and all subdirectories, use:

del /s *.tmp

Warning: Be certain you know exactly what you are doing before using the command. To be more careful, you can specify that the del command will prompt for confirmation before deleting each file:

del /s /p *.tmp

 

6 Comments -


  1. Rajesh said on January 13, 2009

    May I know how to the “folders” instead of files recursively?
    (Assume the folders aren’t empty.)

  2. Rajesh said on January 13, 2009

    ** May I know how to DELETE the “folders” instead of files recursively?
    (Assume the folders aren’t empty.)

  3. dhanu said on February 10, 2009

    thank you very much

  4. Anonymous said on February 25, 2010

    Thanks for this. It works in seconds.

  5. Radsdau said on August 10, 2010

    This tells you how:
    http://www.daniweb.com/forums/thread61479.html

  6. Roshan said on May 3, 2011

    Thanks!

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -