Like what I have to say? Subscribe to my blog via RSS or email, and you'll be notified whenever there's a new blog post!
Subscribe to Alvin Poh's Blog by RSS reader
Subscribe to Alvin Poh's Blog by Email
Subscribe to Alvin Poh's Blog by RSS reader
Subscribe to Alvin Poh's Blog by Email
Gadgets, Technology, Public speaking and IT from an undergraduate's perspective.
Recursively Delete Files and Retain Folders in Windows
I was trying to delete all files in the current directory and all subdirectories, while keeping the directory structure intact. I found that I could use the following DOS command to recursively delete files, and NOT touch the directories:
ending in .doc
del /s *.doc
Do note though, that ALL files with the extension doc will be deleted. You can change .doc to something else, .mp3 .pdf .wav .am .rm .txt, it’s all up to you. If you require confirmation before deleting, you can have the del command prompt for confirmation before deleting each file by modifying the command slightly:
del /s /p *.doc
Subscribe to my blog:
RSS reader
Email
You might also be interested in these:
- Example FTP Session in UNIX
- Recursively Delete Selected Files or Folders In Windows
- Common Useful UNIX Commands
- Recursively Download Folders using FTP with wget in UNIX (even SSH)
- Windows CMD Command Prompt Windows Keep Closing (Or Doesn’t Stay Open)




Yea, Worked well. Thanks I was looking for this solution. You can find more tricks here http://neps.in/category/tech-tips-n-tricks/
Keep up the good work.
Napoleon