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

I have main a folder say E:\donuts and there are hundreds of folders inside it. e.g.


I want to create a new folder in each subfolder simply using some DOS command. Something like this.


and so on. How can I achieve this?

Also, would to be possible move the content of each subfolder into the corresponding big folder? For instance all the files and folders in E:\donuts\yellow\ should move to E:\donuts\yellow\big and so on.

share|improve this question
up vote 3 down vote accepted

I haven't tested this, so you'll want to try it out first

FOR /d %A IN (e:\donuts\*) DO mkdir "%A\big"

This should work to do the move as well:

FOR /d %A IN (e:\donuts\*) DO mkdir "%A\big" & mv "%A\*.*" "%A"
share|improve this answer
Wow @paul, the first one worked like a charm. I hope the second one will work too. Thanks a lot. I have been try various combos the whole evening but now I see my syntax was wrong. – nomidesigns Nov 20 '11 at 4:22
Slight modification on the second command worked for me. It moved all the files sans folders. How can I change it to move the folders too? FOR /d %A IN (e:\donuts*) DO mkdir %A\big & move %A*.* %A\big\ – nomidesigns Nov 20 '11 at 4:48
Oops yeah, well done. – Paul Nov 20 '11 at 13:10
Yeah @Paul thanks to you I'm almost there but the above command only moves files not folders. How can i achieve that? – nomidesigns Nov 20 '11 at 19:30
You can't easily unfortunately, the move command doesn't accept wildcard directory names – Paul Nov 20 '11 at 21:21

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.