Any help with this issue would be greatly appreciated.
I used Win32_Process.CommandLine property and it seems to work with both
wscript.exe and cscript.exe.
Set objSWbemServices = GetObject ("WinMgmts:Root\Cimv2")
Set colProcess = objSWbemServices.ExecQuery _
("Select * From Win32_Process")
For Each objProcess In colProcess
If InStr (objProcess.CommandLine, WScript.ScriptName) <> 0 Then
WScript.Echo objProcess.Name, _
objProcess.ProcessId, _
objProcess.CommandLine
End If
Next
--
urkec
Thank you very much urkec, now I can finish my work.