Kodi Community Forum
Create folder based on file names - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
---- Thread: Create folder based on file names (/showthread.php?tid=105783)



Create folder based on file names - maw230 - 2011-07-18

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/FMExamp/Create-Folders-From-File-Name.htm

and then this XP script, but I am running win7:
http://www.computing.net/answers/windows-xp/create-folders-based-on-file-names/155238.html

Surely someone has needed this before!


- PatK - 2011-07-18

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


- maw230 - 2011-07-18

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...


- spiff - 2011-07-18

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.


- getafix - 2011-07-18

Look here.

It's what you are looking for

G


- maw230 - 2011-07-18

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.


- getafix - 2011-07-18

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


- maw230 - 2011-07-18

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.


This forum uses Lukasz Tkacz MyBB addons.