I have a scant bit of scripting that I need to do for windows using VB Script.
The names on my mp3s are not quite right. However, the advanced properties have the proper Artist and song title. I want to fix these en masse using vb script.
I've done this kind of thing a dozen times before, but for some reason I am having problems with it now.
Here is my current script:
Dim objFile
Dim strFileName
Dim FS
Dim objID3
Dim strFldrSource
Dim strFldrDest
'<-------------------->
Set FS = CreateObject("Scripting.Fi
leSystemOb
ject")
Set objID3 = CreateObject("CDDBControl.
CddbID3Tag
")
strFldrSource = "C:\temp\Music\"
'On Error Resume Next
CorrectMusic
Set FS = nothing
Set objID3 = nothing
'<--- END --->
Sub CorrectMusic()
For Each objFile In FS.GetFolder(strFldrSource
).Files
objID3.LoadFromFile objFile.Path, False
strFileName = objID3.LeadArtist & " - " & objID3.Title
strSourceFile = objFile.Path
strDestFile = strFldrSource & strFileName & ".mp3"
strAltDestFile = strFldrSource & strFileName & "~" & objFile.Name
If FS.FileExists(strDestFile)
Then
objFile.Move strAltDestFile
Else
objFile.Move strDestFile
End If
Next
End Sub
I have changed lines 39 and 41 several times between using the FSO.MoveFile and FSO.CopyFile to the objFile.Move and objFile.Copy. No dice.
I *always* get the error: 800A0005 - Invalid Procedure Call or Argument.
if I perform a FSO.copyfile <sourceFilePath>, <DestinationFolder> it works fine.... but I want to incorporate the new name, and that fails.
I either (a) need this script fixed or (b) need some script (js or otherwise) that can read the advanced ID3 properties of an mp3 file and change the file name to match: <artist> - <song title>.mp3
Start Free Trial