.ExpandEnvironmentStrings

Expand a Windows environment variable.

Syntax 
      objShell.ExpandEnvironmentStrings(strString)

Key

   objShell    A WScript.Shell object

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

Examples

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 cmdlet: Get-Item env:HOMEDRIVE or $env:HOMEDRIVE


 
Copyright © 1999-2024 SS64.com
Some rights reserved