You are on page 1of 1

iTunes Dupe Killer VBscript

here's a little script to remove those annoying itunes duplicates.


just needs some modification such as your itunes directory...
-----------------
Set objFSO = Wscript.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("D:\iTunes")
Set colSubFolders = objFolder.Subfolders
'get inside each artist's folder
For Each objSubFolder in colSubFolders
'Wscript.Echo objSubFolder.Name
'once inside the folder do the following...
Set colSubSubFolders = objSubFolder.Subfolders
'Get inside each album folder
For Each objSubSubFolder in colSubSubFolders
'once inside do the following
'WScript.Echo vbtab & objSubSubFolder.name
Set colMP3Files = objSubSubFolder.Files
For Each objMP3File in colMP3Files
'Wscript.Echo vbtab & objMP3File.Name
strCurrentMP3Name = objMP3File.Name
For Each objMP3File2 in colMP3Files
'Wscript.Echo Left(strCurrentMP3Name, Len(strCurrentMP3Name)-4) &
vbtab & Left(objMP3File2.Name, Len(objMP3File2.Name)-6)
If UCase(Left(strCurrentMP3Name, Len(strCurrentMP3Name)-4)) =
UCase(Left(objMP3File2.Name, Len(objMP3File2.Name)-6)) Then
'Wscript.Echo(UCase(strCurrentMp3Name & vbtab & objMP3File2.Name))
Wscript.Echo objMP3File2.Path
objFSO.DeleteFile(objMP3File2.Path)
End If
Next
Next
Next
Next

You might also like