Core Function ProcessExists
From Sputnik Wiki
(Difference between revisions)
(→Example) |
(→Remarks) |
||
Line 23: | Line 23: | ||
Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe" | Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe" | ||
− | If multiple processes have the same name, the one with the highest PID is | + | If multiple processes have the same name, the one with the highest PID is returned--regardless of how recently the process was spawned. |
PID is the unique number which identifies a Process. | PID is the unique number which identifies a Process. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Example === | === Example === |
Revision as of 20:13, 7 December 2011
ProcessExists( <pid/name> )
Contents |
Description
Checks to see if a specified process exists.
Parameters
pid/name
The name or PID of the process to check.
Return Value
Success: Returns the PID of the process.
Failure: Returns 0 if process does not exist.
Remarks
Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"
If multiple processes have the same name, the one with the highest PID is returned--regardless of how recently the process was spawned.
PID is the unique number which identifies a Process.
Example
If ($PID = ProcessExists("notepad.exe")) { MsgBox("Notepad is running and its PID is '$PID'"); } else { MsgBox("Notepad not is running."); }