Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias exe {
- if (!$1-) { return }
- .comopen a wbemScripting.swbemLocator
- .comclose a $com(a,connectserver,3,bstr,.,bstr,root\cimv2,dispatch* b)
- .comclose b $com(b,execquery,3,bstr,SELECT * FROM Win32_Process WHERE Name = $qt($1),dispatch* c)
- noop $regsubex($str(.,$iif(!$2,$comval(c,0),$2)),/(.)/g,$comval(c,\n,$iif($prop == kill,terminate)))
- .comclose c
- var %st = $regml(0)
- if (%st) { return $true }
- elseif (!%st) { return $false }
- ;return $regml(0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement