mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2005
Posts: 127
H
HAMM3R Offline OP
Vogon poet
OP Offline
Vogon poet
H
Joined: Jun 2005
Posts: 127
Hey. I need to find the path to all running mirc.exe processes. This process information script gets the file path of the process like i need, but lists it in a window, as well as ALL processes. I only want to it to return the path of all mirc.exes running. I need to it use with a $read command, so I need to return the info rather than display it in a window. Does anyone know of an efficent way to do this? Thanks in advance!

Austin


-- HAMM3R (aka: alhammer)
http://www.HAMM3R.net
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
/*

Usage: /mircpaths

The paths to the mIRC's are stored in hash table "mircpaths" with item being the number, and data being the path. In other words if you have 2 clients open then:

$hget(mircpaths,1) = path to first client
$hget(mircpaths,2) = path to second client

Code requires atleast 6.16 and more than likely Win2k professional or higher.

*/

Code:
alias mircpaths {
  if ($version < 6.16) return 
  var %loc = loc $+ $ticks, %wmi = wmi $+ $ticks, %col = col $+ $ticks
  .comopen %loc WbemScripting.SWbemLocator
  if (!$comerr) .comclose %loc $com(%loc,ConnectServer,1,dispatch* %wmi) 
  if ($com(%wmi)) .comclose %wmi $com(%wmi,ExecQuery,1,bstr*,SELECT $&
    executablepath FROM Win32_Process WHERE Name = "mirc.exe",dispatch* %col) 
  if (!$com(%col)) return
  if ($hget(mircpaths)) hdel -w mircpaths *
  var %i = 1
  while ($comval(%col,%i,executablepath)) { 
    hadd -m mircpaths %i $v1
    inc %i
  }
  .comclose %col
}


Gone.
Joined: Jun 2005
Posts: 127
H
HAMM3R Offline OP
Vogon poet
OP Offline
Vogon poet
H
Joined: Jun 2005
Posts: 127
I love you Fiber. It worked perfect. grin


-- HAMM3R (aka: alhammer)
http://www.HAMM3R.net

Link Copied to Clipboard