.ExpandEnvironmentStrings

Expand a Windows environment variable.

Syntax 
      objShell.ExpandEnvironmentStrings(strString)

Key

   objShell    A WScript.Shell object

   strString   A PROCESS environment variable 
                    (enclosed with "%" characters)

Example

Set objShell = WScript.CreateObject("WScript.Shell")
MsgBox "Prompt is " & objShell.ExpandEnvironmentStrings("%PROMPT%")

Note: Variable names are not case-sensitive.

”I would rather train someone and lose them, than not train them and keep them” ~ Zig Ziglar

Related
:

Environment, Read Environment variables
Equivalent Windows CMD command: SET - Display, set, or remove environment variables
Equivalent Powershell command: Get-Item env:HOMEDRIVE or $env:HOMEDRIVE


© Copyright SS64.com 1999-2014
Some rights reserved