Kodi Community Forum

Full Version: Create folder based on file names
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have over 500 movies that are all thrown together sloppily with their .nfo and .tbn files in one folder. I want a program or command that will create a folder based on each movie and then add files of similar name to that folder.

So far I have found this: http://www.monkeyjob.com/FileMonk/FMExam...e-Name.htm

and then this XP script, but I am running win7:
http://www.computing.net/answers/windows...55238.html

Surely someone has needed this before!
I've used this one.... cut&paste it into notebook file and call it foldermaker.bat but it will make a folder of everything including itself and stick the files inside.

Test it out... in a 'test' folder with a few files...

@echo off
for %%a in (*.*) do (
md "%%~na" 2>nul
move "%%a" "%%~na"
)
pause
PatK Wrote:I've used this one.... cut&paste it into notebook file and call it foldermaker.bat but it will make a folder of everything including itself and stick the files inside.

Test it out... in a 'test' folder with a few files...

@echo off
for %%a in (*.*) do (
md "%%~na" 2>nul
move "%%a" "%%~na"
)
pause

Cool thx i will give it a shot later.

But wait, it will create a new folder for each file? I need one folder and then like files to be placed in it...
Code:
@echo off
for %%a in (*.nfo) do (
md "%%~na" 2>nul
move "%%~na.*" "%%~na"
)

i don't speak batch (or well, i haven't since 1998 or thereabout), but if i decoded the original code this should do it.
Look here.

It's what you are looking for

G
getafix Wrote:Look here.

It's what you are looking for

G

Nice! I wonder though if the files have to have the exact same names, but with different extensions? Or will it use *like* names?

spiff Wrote:
Code:
@echo off
for %%a in (*.nfo) do (
md "%%~na" 2>nul
move "%%~na.*" "%%~na"
)

i don't speak batch (or well, i haven't since 1998 or thereabout), but if i decoded the original code this should do it.

Cool. Appreciate it.
maw230 Wrote:Nice! I wonder though if the files have to have the exact same names, but with different extensions? Or will it use *like* names?

No, I think that it makes an exact copy excluding the extensions. I haven't used it in a while but I remember it working perfectly
getafix Wrote:No, I think that it makes an exact copy excluding the extensions. I haven't used it in a while but I remember it working perfectly

Only one way to find out.