Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have a folder with 80 localizations. Since I do speak only two languages, I do not need the remaining 78. Of course I could type del /S /F /Q for every single one of them.

But I wonder if there's a way to specify file names that are to stay, and run a for command for every file in a directory. Is this possible?

share|improve this question
up vote 2 down vote accepted

The most painless way would be to give a distinguishing attribute to those 2 files:
attrib +R english
attrib +R otherlang
then delete every file that doesn't have that attribute:
del /A:-R *.*
Then you can clear the attributes if you wish.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.