Automate the mundane for sanity sake (part 4)

A recent change in My Movies results in users having to have the rips be conformant with the DVD standards, specifically it now requires that the VOB, IFO, and BUP files are in a VIDEO_TS folder.

I threw together a very basic script that can take folders that are in the form of sourcedir\moviename\dvdfiles to sourcedir\moviename\video_ts\dvdfiles.

As always use this script at your own risk, I have only done limited testing, but it worked on the two folders I tried .

To use this copy the following script to foo.vbs, put it in the root of your movies folder, open a command prompt in that directory and type "cscript foo.vbs" and you should be good to go.

I recommend trying it on a small folder set before you run it on your whole collection to make sure you would be happy with the results.

Dim FileSystem, szMovieFolder
szMovieFolder = "C:\test"
Set FileSystem = CreateObject("Scripting.FileSystemObject")

Dim Folder, File, Files, oMovieFolder, szFolderName, iEndOfShortFileName, szDestPath
Set oMovieFolder = FileSystem.GetFolder(szMovieFolder)

Set Folders = oMovieFolder.SubFolders

For Each Folder in Folders

 szFolderName = szMovieFolder  & "\" & Folder.Name 

 If (FileSystem.FileExists(szFolderName & "\" & "VIDEO_TS.ifo")) = True Then

  ' Looks like we have a movie name folder that directly contains a VIDEO_TS.IFO

  szDestPath = szFolderName & "\" & "VIDEO_TS"

  If (FileSystem.FolderExists(szDestPath)) = False Then

   ' Looks like it also does not yet have a VIDEO_TS folder

   FileSystem.CreateFolder(szDestPath)

   ' Now it does!


   Set Files = Folder.Files


   For Each File In Files
    bMove = False

    ' If its a VOB, BUP, or IFO move it.
    If InStr(1, LCase(File.Name), ".vob") <> 0 Then bMove = True
    If InStr(1, LCase(File.Name), ".ifo") <> 0 Then bMove = True
    If InStr(1, LCase(File.Name), ".bup") <> 0 Then bMove = True

    if bMove = True then
     ' ok lets move file
     wscript.echo "Moving '" & File.Name & "' to '" & szDestPath & "'"
     File.Move(szDestPath & "\" & File.Name)

    end if
   Next

  End If
 End If
Next

Good luck.

Print | posted on Sunday, June 22, 2008 4:23 PM

Feedback

No comments posted yet.
Title  
Name  
Email
Url
Comments   
Please add 5 and 7 and type the answer here: