I have main a folder say E:\donuts and there are hundreds of folders inside it. e.g.
E:\donuts\yellow\
E:\donuts\green\
...
E:\donuts\blue\
I want to create a new folder in each subfolder simply using some DOS command. Something like this.
E:\donuts\yellow\big
E:\donuts\green\big
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.
Answer
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"
No comments:
Post a Comment