rovf has asked for the wisdom of the Perl Monks concerning the following question:
I have a PID, and would like to know whether a process with this PID is running on my host. What is a good way to do this?
On Unix, I would simply do a kill(0,$pid), but - as is explained in perlport - this does not work on Windows. I could shell out and call the Windows utility wmic, which is neither elegant, not safe, since it might happen that the wmic process itself gets, by chance, the PID I am going to check. I could also use Win32::Process::Info, but the plenty of "warnings" and "caveats" in the description of this module frightens me, to be honest.
Any other ideas? BTW, any solution must work on Windows XP and Windows 7.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple way to find on Windows, whether a process is running
by BrowserUk (Patriarch) on Sep 09, 2011 at 14:03 UTC | |
by rovf (Priest) on Sep 09, 2011 at 14:34 UTC | |
by BrowserUk (Patriarch) on Sep 09, 2011 at 14:45 UTC | |
by rovf (Priest) on Sep 12, 2011 at 08:54 UTC | |
by BrowserUk (Patriarch) on Sep 12, 2011 at 10:02 UTC | |
by Anonymous Monk on Sep 12, 2011 at 09:14 UTC | |
|