Any way to automate moving each movie into its own folder? (1 Viewer)

hazmatte

Portal Member
January 5, 2006
9
0
I want to restructure my movie folders so that each movie gets put in it's own folder, but I've got a ton of movies (over 500), so doing it by hand isn't really an option. With each movie there could be an associated .sub/.srt subtitle file, a cover .jpg, and possible multi-parts, so the method would have to be fairly intelligent about creating the subfolders and moving/renaming the files.

Currently my movies are all stored in my movies directory in this format:
Amores Perros (2000)-CD1.jpg
Amores Perros (2000)-CD1.sub
Amores Perros (2000)-CD1.avi
Amores Perros (2000)-CD2.sub
Amores Perros (2000)-CD2.avi
Babel (2006)-CD1.avi
Babel (2006)-CD1.jpg
Babel (2006)-CD2.avi

Is there any utility or automated way to change it to something similar to this:
Amores Perros (2000)/folder.jpg
Amores Perros (2000)/Amores Perros (2000)-CD1.sub
Amores Perros (2000)/Amores Perros (2000)-CD1.avi
Amores Perros (2000)/Amores Perros (2000)-CD2.sub
Amores Perros (2000)/Amores Perros (2000)-CD2.avi
Babel (2006)/folder.jpg
Babel (2006)/Babel (2006)-CD1.avi
Babel (2006)/Babel (2006)-CD2.avi


Thanks,
haz
 

mickelin

Portal Pro
September 29, 2006
77
7
Home Country
Sweden Sweden
Or you could use a program called MoveIt2. The trial version can do this for you free of charge and no programming/scripting involved. Google it!
 

hazmatte

Portal Member
January 5, 2006
9
0
Or you could use a program called MoveIt2. The trial version can do this for you free of charge and no programming/scripting involved. Google it!

I took a look at this program and found it a little daunting. I tried to do a few test operations with it and got some errors, not sure why, maybe because I was trying to move some files over a network share. Any other tools similar in function to this?
 

ppersaud

New Member
December 29, 2008
2
0
Home Country
United States of America United States of America
Make a Folder for Each Movie

I found this script on the internet and it works great:

Option Explicit
Dim objFSO,srcRoot,objFolder,File,dstRoot,theName,dst,dstFile
Set objFSO=CreateObject("Scripting.FileSystemObject")
srcRoot="\\Server\videos\New Rips\zzzzzzzzzzzzzzzzzzzz"
dstRoot="\\Server\videos\New Rips\zzzzzzzzzzzzzzzzzzzz"
Set objFolder=objFSO.GetFolder(srcRoot)
For Each File In objFolder.Files
If objFSO.GetExtensionName(File) = "avi" Then
theName= Split(File.Name, ".")(0)
dst=dstRoot & "\" & theName
dstFile=dst & "\" & File.Name
If Not objFSO.FolderExists(dst) Then
objFSO.CreateFolder(dst)
End If
objFSO.MoveFile File, dstFile
End If


Paste the above script in notepad and save it with a .vbs extension: Makemoviefolder.vbs

Change the source path (srcRoot=). I have "\\Server\videos\New Rips\zzzzzzzzzzzzzzzzzzzz" in the script above. You could use "C:\My Documents\My Videos".

Change the destination path (dstRoot=). I have "\\Server\videos\New Rips\zzzzzzzzzzzzzzzzzzzz" in the script above. You could use "C:\My Documents\My Videos".

Change the file extension to the appropriate extension (mpg, vob, avi) on the line with "objFSO.GetExtensionName(File) = "avi"". I have avi in the script above.

Open a command line interface. You can do this by typing "cmd" in the run (XP) or text box on the start button (Vista).

run the script using the using the "cscript" command. Example: cscript c:\temp\makemoviefolder.vbs

It worked for me on my Windows Home Server using a client machine to run the script as you can see from the code above. Use at your own risk, but you can see the code and it is pretty straight forward.

Regards, :)

Philippe
 

Users who are viewing this thread

Top Bottom