$process
Posted by Parasite-FT-
Monday, October 04, 2004
Description: Gives info about or terminates Nth process
Ghost2 just made an '$isproc' ident to determine if a process is running, however this will allow you to get information on any/all processes running (this has only been tested on XP, and only on my client at that).
You can find a list of all the properties available at the following link: MSDN [msdn.microsoft.com]
A few examples:
echo $process(0).Name <-- returns the number of processes running
echo $process(1).Name <-- returns the name of the 1st process
echo $process(1).ExecutablePath <-- returns the file path of the process
echo $process(1).Terminate <-- terminates the 1st process
I got a lot of this from the $com tut by ShredPlayer on mircscripts.org so the credit should go there. Hope this is useful to someone :o
Cheers,
- Para
Ghost2 just made an '$isproc' ident to determine if a process is running, however this will allow you to get information on any/all processes running (this has only been tested on XP, and only on my client at that).
You can find a list of all the properties available at the following link: MSDN [msdn.microsoft.com]
A few examples:
echo $process(0).Name <-- returns the number of processes running
echo $process(1).Name <-- returns the name of the 1st process
echo $process(1).ExecutablePath <-- returns the file path of the process
echo $process(1).Terminate <-- terminates the 1st process
I got a lot of this from the $com tut by ShredPlayer on mircscripts.org so the credit should go there. Hope this is useful to someone :o
Cheers,
- Para
;; Function: returns the Nth process info
;; Usage: $process(<N>)<.property>
alias process {
.comopen A WbemScripting.SWbemLocator
if ($com(A)) .comclose A $com(A,ConnectServer,3, dispatch* B)
if ($com(B)) .comclose B $com(B,ExecQuery,3,string,SELECT * FROM Win32_Process,dispatch* C)
if ($com(C)) { var %return = $comval(C,$1,$prop) | .comclose C }
return %return
}