tglogo.png
0 LIKES

Snippet


$exe() identifier by ^WeSt

In Category General IRC Posted by Snippets On 12/06/23
Tags: exe west 

You can check for a running .exe progress on tasklist via that identifier.
Usage:

$exe(name.exe)[.total]
(If the exe that your specified exist then it will return $true otherwise will be returned $false)

.total (optional) = Will return the total exe programs that running with that name you specified.
Examples:

//echo -a Exe: $exe(mirc.exe)
//echo -a Exe: $exe(mirc.exe).total
alias exe {
  if (!$1-) { return }
  var %com1 = exe1_ $+ $ticks
  var %com2 = exe2_ $+ $ticks
  var %com3 = exe3_ $+ $ticks
  .comopen %com1 WbemScripting.SWbemLocator
  if ($comerr) { goto error }
  .comclose %com1 $com(%com1,ConnectServer,3,bstr,.,bstr,root\cimv2,dispatch* %com2)
  .comclose %com2 $com(%com2,ExecQuery,3,bstr,SELECT * FROM Win32_Process WHERE Name = $qt($1),dispatch* %com3)
  noop $regsubex($str(.,$comval(%com3,0)),/(.)/g,$comval(%com3,0,0))
  :error
  if ($com(%com1)) { .comclose $v1 }
  if ($com(%com2)) { .comclose $v1 }
  if ($com(%com3)) { .comclose $v1 }
  var %st = $regml(0)
  if (%st) { return $iif($prop && $prop == total,%st,$true) }
  elseif (!%st) { return $iif($prop && $prop == total,0,$false) }
}


Comments 0


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand