VBS Getting its Process ID by Bryan
Bryan
Thu Jul 31 07:35:20 CDT 2003
Thanks for the input, what I finaly ended up doing was
executing CMD.EXE via WshShell.Exec which returned an
WshScriptExec object. One of the Properties of the
WshScriptExec object is the ProccesID of the command. I
took that PID and went through WMI until I found the
matching PID. Once I had the correct WMI object I read
the ParentProcessID property, which gave me the
information I was looking for. Finally I terminated the
CMD.exe via the WshScriptExe.Terminate method.
>-----Original Message-----
>I know I must be missing it in the documentation, but I
>can't find it. Is there are way for a VBS script to
>determine its process ID?
>
>There may be multiple wscript.exe running, so I can't
>just look for wscript.exe in the process table. If I was
>running XP, I am running NT, I could use the CommandLine
>Parameter.
>
>Thanks for any help you could provide,
>
>Bryan
>.
>