WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: NateT on February 28, 2014, 08:15:48 AM

Title: my script's process id
Post by: NateT on February 28, 2014, 08:15:48 AM
How do I find my running compiled script's process ID with the consideration that there may be more than one instance of the script running (i.e. I can't just look it up by name using tListProc)?
Title: Re: my script's process id
Post by: ChuckC on February 28, 2014, 08:45:04 AM
The following will get the PID of the process that is executing your script:

ThisPid = DllCall("kernel32.dll", long:"GetCurrentProcessId")

Title: Re: my script's process id
Post by: NateT on February 28, 2014, 08:47:07 AM
That is exactly what I needed.  Thank you very much.