alias isprocess {
var %a = a $+ $ticks, %b = b $+ $ticks, %c = $false
.comopen %a WbemScripting.SWbemLocator
if ($com(%a)) {
.comclose %a $com(%a,ConnectServer,3,dispatch* %b)
if ($com(%b)) {
.comclose %b $com(%b,ExecQuery,3,bstr,Select Name From Win32_Process Where Name = ' $+ $1',dispatch* %a)
if ($com(%a)) {
noop $com(%a,Count,3)
if ($com(%a).result) %c = $true
.comclose %a
}
}
}
return %c
}