Create new dir based on dir names

July 28, 2009 at 13:40:09
Specs: Windows XP, Athlon 64 3400+@2.75
I need to know if there is a way to create new folders based on current folder names, then copy those folders into them. So I'd start out with a list of folders:

123-555558
123-485604
1-4284750
1-334
22-56
22-48573

basically <word/number>-<other stuff>. I'd want to end up with, in the above example, folders named:
123
1
22
and the corresponding folders inside of them. Can anyone help?


See More: Create new dir based on dir names

Report •


#1
July 29, 2009 at 04:10:43
@echo off & setLocal EnableDELAYedExpansion

for /f "tokens=1-2 delims=-" %%a in (myfile) do (
echo md %%a-%%b\%%a\%%b
)


=====================================
If at first you don't succeed, you're about average.

M2


Report •
Related Solutions


Ask Question