I have read about a number of folks on the mymovies.name forum wanting to move individual files into dedicated folders but expressing concern about the repetative nature of this basic task.
Well with that in mind I put together a simple script that does just that, its been used by a few people without problem so I figured I would share with others so they could use it if they want too:
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 Files = oMovieFolder.Files
For Each File In Files
' is there a folder for this already?
iEndOfShortFileName = InStr(1, File.Name, ".")
szFolderName = Mid(File.Name, 1, iEndOfShortFileName -1)
If (FileSystem.FolderExists(szFolderName)) = False Then
' nope lets make one
szDestPath = szMovieFolder & "\" & szFolderName
wscript.echo "Creating '" & szDestPath & "'"
FileSystem.CreateFolder(szDestPath)
End If
' ok lets move file
wscript.echo "Moving '" & File.Name & "' to '" & szDestPath & "'"
File.Move(szDestPath & "\" & File.Name)
Next
This is far from rocket science but a quick and dirty way to get the job done, hope it helps someone.