REM FINDCDART.VBS: scan music folders and print those without "album art" REM Put this script file in the root My Music folder and execute it; REM missing folder names (if any) are saved in a file called REPORT.TXT REM By N.A.Bozinis @ 19/09/2013 17:09:08 REM ------------------------------------------------- option explicit Dim oShell, oFile, oFSO ' variables defined up here are global to the subroutine Set oFSO = CreateObject("Scripting.FileSystemObject") set oFile = oFSO.CreateTextFile("report.txt", True) oFile.WriteLine("Music folders without album art") oFile.WriteLine("-------------------------------") ' examine all folders starting from where we are located (WScript.ScriptFullName) Set oShell = WScript.CreateObject("WScript.Shell") call listdir(oShell.CurrentDirectory) oFile.Close Wscript.Echo "done, inspect REPORT.TXT" oShell.Run "report.txt" REM recursion REM --------- Sub listDir(what) Dim oDir, bHasMP3, bHasJPG, f, strType, strExt Set oDir = oFSO.GetFolder(what) ' see if there is any MP3 file and also if there is any JPG file bHasMP3 = false bHasJPG = false ' there isn't an easy way to do wildcards, so just check file types For Each f in oDir.Files strType = lcase(f.Type) if Instr(strType, "audio") > 0 OR Instr(strType, "sound") > 0 then bHasMP3 = true end if ' image files don't have convenient types for detection, check extension strExt = oFSO.GetExtensionName(lcase(f.name)) if strExt="jpg" OR strExt="gif" OR strExt="png" OR strExt="jpeg" OR strExt="bmp" then bHasJPG = true if bHasJPG AND bHasMP3 then exit for Next if bHasMP3 AND NOT bHasJPG then ' we must find album art for this one! oFile.WriteLine(what) end if ' recursively enter subfolders For Each f in oDir.subfolders call listdir(what & "\" & f.name) Next end sub