Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am deleting multiple files with the command:

del /s *.doc *.rtf *.txt

I get the error Could Not Find *.doc.

How can I get the command to continue deleting RTF and TXT files when there are no more DOC files?

I want to use a single command so I can traverse the subdirectories once, instead of executing a delete command for each file type individually.

share|improve this question

migrated from stackoverflow.com Oct 9 '11 at 0:19

This question came from our site for professional and enthusiast programmers.

Do you have to have it on one line of code? If yes, I'm a C# dev, so I'd write a quick app to do it (overkill yes!). Maybe powershell can help? –  Dave Mateer Oct 8 '11 at 20:49

1 Answer 1

It just says so because it couldn't find any .doc files; it still deletes all other files matching the arguments.

If you just don't like the message, then redirect it away:

del /s *.doc *.rtf *.txt 2>nul
share|improve this answer
Ceci n'est pas une pipe! –  JdeBP Oct 10 '11 at 11:14
Meh............ –  Joey Oct 10 '11 at 11:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.