alias envar {
if !$1 { return }
if $com(a) { .comclose a }
.comopen a WScript.Shell
if $comerr { return }
var %a $com(a,ExpandEnvironmentStrings,3,bstr,$iif($+($chr(37),*,$chr(37)) !iswm $1,$+($chr(37),$1,$chr(37)),$1))
%a = $iif($left($com(a).result,1) != $chr(37),1,0)
return $iif($prop == value,$iif(%a == 0,%a,$com(a).result),%a)
.comclose a
}