WshShell.ExpandEnvironmentStrings

The ExpandEnvironmentStrings method expands the PROCESS environment variable in strString and returns the result string. Variables are enclosed by the '%' character.

The environment variable name is not case-sensitive.

Syntax

WshShell.ExpandEnvironmentStrings(strString) = strExpandedString
 

Example

MsgBox "Prompt is " & WshShell.ExpandEnviromentStrings("%PROMPT%")