mainLoc = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")) 'Location of ffmpeg.exe - should be in same folder or \bin subfolder
binLoc = mainLoc & "bin\"       
Set fso = CreateObject("Scripting.FileSystemObject")
dim wSh                                                                                                         'Prepare windows shell object
Set wSh = WScript.CreateObject("WScript.Shell")
if not fso.FileExists(binLoc & "Quick_Any2Ico.exe") and not fso.FileExists(mainLoc & "Quick_Any2Ico.exe") then
        msgbox "FFMPEG not found!" & vbNewLine & vbNewLine & "Please put FFMPEG.exe in same folder as ReEncode script" & vbnewline & "FFMPEG is available from <a href="https://www.ffmpeg.org/" rel="nofollow ugc">Web Link ...</a>"
else
        If WScript.Arguments.Count > 0 Then
                For i = 0 to Wscript.Arguments.Count - 1
                        vidName = Replace(Wscript.Arguments(i), "\", "/")
                        vidNameOut = Replace(vidName, ".", " - REENCODE.")
                        vidNameOut = left(vidNameOut, inStrRev(vidNameOut, ".")) & "ico"
                        if fso.FileExists(binLoc & "Quick_Any2Ico.exe") then
                                cmdString = chr(34) & binLoc & "Quick_Any2Ico.exe" & chr(34) & " -convert " & chr(34) & vidName & chr(34)
                        else
                                cmdString = chr(34) & mainLoc & "Quick_Any2Ico.exe" & chr(34) & " -convert " & chr(34) & vidName & chr(34)
                        end if
                        if videoResolution > 0 then cmdString = cmdString & " -vf " & chr(34) & "scale=-2:" & videoResolution & chr(34)
                        cmdString = cmdstring & " -crop -nopngc -formats=16,32,64,72,96,128,256,512 " & CRF & " -profile:v baseline -level 3.0 -pix_fmt yuv420p -movflags faststart " & params & " " & chr(34) & vidNameOut & chr(34)
                Next
                cmdstring = replace(cmdstring, "/", "\")
                wsh.run cmdString                                                                       'Execute
        end if
end if
