How do I move the contents of 100+ directories up a level?

Aside from doing them one at a time, that is.

Basically, I have un-rared a collection of files. They are each in individual numbered directories. However, for some strange reason, the directories containing the files are nested inside of numbered directories.

The directory structure looks like this:
1>1>files
2>2>files
3>3>files
etc…

I want to reduce it to
1>files
2>files
3>files
etc…

I know I can select all the files manually, move them up a level and then delete the leftover folder. However, I’m not in the mood to do this 100+ times. There must be an easier way!

(OS is Windows 7)

Go to a command prompt, change to the directory with the problem and do this:

for /f %f in (‘dir *. /b’) do move %f%f* %f

After that’s complete and you’ve checked:

for /f %f in (‘dir *. /b’) do rd %f%f /y

I must be doing this wrong as it doesn’t seem to work… but it’s good to know there’s a way!

**Quartz **was close.

Go to a command prompt, change to the directory with the problem then:
Assuming the directoriess are numbered from 1 to 100, do this:

>for /L %n in (1, 1, 100) do move “%n%n*.*” "%n"

After confirming the files have moved successfully, do this:

>for /L %n in (1, 1, 100) do rd "%n%n"

If the number of directories is other than 100, just change the “100” in both the above commands to whatever number is appropriate; 110, 115, whatever.

in the future you should find the option in rar to not create a subdirectory to put the extracted files into. for some types of content the default option is better though in your case it produces an extra step to work around.

I see what the problem was now. The files were already in folders in the archive. When I used “extract each archive to a separate folder” it was creating the unnecessary nesting. I used plain old “extract” on the remaining files and didn’t have a problem.

LSLGuy, thanks for the updated info. Your script works great! All the directories are in proper order now.