I am trying to launch "GetPID.exe" and store the error code. This is the .vbs code :
Set WshShell = CreateObject("WScript.Shell")
strPath = Wscript.ScriptFullName
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPath)
strFolder = objFSO.GetParentFolderName(objFile)
strFolder = strFolder & "\GetPID.exe"
Msgbox strFolder
Dim temppid
temppid = WshShell.Run(strFolder , 0 , True)
However, at the last line, I get the following message:
G:\test001.vbs(11, 1) (null): No application is associated with the specified file for this operation.
The MsgBox echoes the correct path to the exe, so I am confused why is there the error.