Function FileInPath(strFileName, sPath)
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim aPath, intI
FileInPath=False
sPath = ""
aPath=Split(WshShell.ExpandEnvironmentStrings(".;%PATH%"),";")
for intI = LBound(aPath) to UBound(aPath)
if
fso.FileExists(AddTrailingBackSlash(aPath(intI)) & strFileName) then
sPath =
aPath(intI)
FileInPath=True
Exit Function
end if
next
End Function