Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias run {
- var %r $1-
- :varcheck
- if ($regex(%r,/%([0-9a-zA-Z]+)%/S)) {
- var %r $regsubex(%r,/%([0-9a-zA-Z]+)%/Sg,$sysvar(\t))
- goto varcheck
- }
- else {
- if (*Invalid Path* iswmcs %r) { echo $color(info) * /run: one or more variables were invalid. | halt }
- !run %r
- }
- halt
- :error
- haltdef
- echo $color(info) $gettok($error,1,40)
- reseterror
- halt
- }
- alias sysvar {
- var %var $1
- unset %error
- .comopen s Wscript.Shell
- noop $com(s,RegRead,1,bstr,$+(HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\,%var))
- var %x $com(s).result
- noop $com(s,RegRead,1,bstr,$+(HKCU\Volatile Environment\,%var))
- var %y $com(s).result
- noop $com(s,RegRead,1,bstr,$+(HKCU\Software\Liter\SystemInfo\SystemFolders\,%var))
- var %z $com(s).result
- .comclose s
- return $iif(%x,$v1,$iif(%y,$v1,$iif(%z,$v1,Invalid Path)))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement