imho they're different, they're not vars. I'm not saying I'm necessarily right or wrong on this point. Just wanted to point-out some inconsistencies in the "rules" and get some opinion. I posed this @macro/%var% question to Ruud ages ago when he first came out with NoVarsInStrings ... and he didn't bite. To be honest, think (he thinks) its a bit of a rat hole to go down.

The question is, is there really a fundamental difference between this:

$x = "$windir\system32"

and this:

$x = "%windir%\system32"

and if not, then should "best practice" be:

$x = %windir% + "\system32"

I myself don't get too worried about vars-in-strings - our corp login script (even the newest one we just did) are riddled with them. Were we (I) concerned about $vars being not supported in the future ? Sure was - but I truely think Ruud will never "go there" ... thoughts ?


By the way, the HKLM / HKCU thingy is different because if they were expressed outside of quotes, it would break another "rule". It would be an un-quoted string (which some have been quilty of doing too :0) )

$key = HKCU + "\Control Panel"

funny enough though, that syntax still works