1.

Solve : Creating Folders from List of Files?

Answer»

Hello.

I have a bunch of files (in the hundreds) & I wish to put each in their own folder.

Code: [Select]X:\birthday2007.avi becomes Code: [Select]X:\birthday2007\birthday2007.avi
Does ANYBODY know how to do this? As I said, I have several hundred files. So I would need it to be done all at once.

Thanks. I actually just found a PROGRAM called Files 2 Folder. It seems to do the trick nicely.

Thanks.For any future EXPLORERS...

This is untested: try it on a folder of test files first - don't run the batch file from x:\ as well.

Code: [Select]echo off
for %%a in (x:\*.avi) do (md "%%~dpna" 2>nul & move "%%a" "%%~dpna")
pause

And to do it recursively:

Code: [Select]echo off
for /F "delims=" %%a in (' dir /b /s /a-d "x:\*.avi" ') do (md "%%~dpna" 2>nul & move "%%a" "%%~dpna")
pause



Discussion

No Comment Found