Skip to content
TG007 community snippet #138

$exe() identifier by ^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

By Snippets Added Dec 6, 2023
General IRC All snippets
mIRC script 18 lines
About this snippet

Overview

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
Source code

mIRC script

18 lines · 753 characters
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) }
}
Community

Comments

Want to join the discussion? Sign in to TG007.
No comments yet. Start the discussion.