Just to clarify Mart's reference, if you build a string like this:
$sTmp = "%WINDIR%" + " is the windows root folder." + @CRLF
Kix will automatically reference the contents of the %WINDIR% variable.

When you read the value from the registry, and the registry value type is REG_SZ, it will return the environment variable name, just as it appears in the data in the registry. Since the env-var is embedded in the string, you need to use the ExpandEnvironmentVars(). Often, we use something like:
 Code:
$Value = ExpandEnvironmentVars(ReadValue($Key))


Keep in mind that some registry values are the type REG_EXPAND_SZ. These can hold an environment variable, but the act of reading this value performs the required environment variable replacement automatically. Using the medhod above provides no advantage, but doesn't hurt either. I point this out because sometimes you read a value and get what you expect, and other times you get a raw environment var - the difference is the value data type.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D