Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias wmiget {
- var %ar = a $+ $ticks $+ $ctime $+ $rand(1,10000)
- var %br = b $+ $ticks $+ $ctime $+ $rand(1,10000)
- var %cr = c $+ $ticks $+ $ctime $+ $rand(1,10000)
- .comopen %ar WbemScripting.SWbemLocator
- if ($comerr) { .comclose %ar | return 0 }
- .comclose %ar $com(%ar,ConnectServer,3,dispatch* %br)
- if ($comerr) { return 0 }
- .comclose %br $com(%br,ExecQuery,3,bstr*,select $prop from $1,dispatch* %cr)
- var %x = $remove($comval(%cr,$iif($2,$2,1),$prop),$chr(9),$chr(10),$chr(13))
- :error
- if ($com(%ar)) { .comclose %ar }
- if ($com(%br)) { .comclose %br }
- if ($com(%cr)) { .comclose %cr }
- return $iif(%x,%x,0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement