Microsoft Operations Manager |
The ExpandEnvironmentStringsmethod expands environment-variable strings to their defined values.
[VBScript]
Utility.ExpandEnvironmentStrings(Instring Variant)
String
The following example shows how to get an expanded environment variable.
[VBScript]
Function GetProgramFolder()
Dim objUtil, strEnvValue
Set objUtil = CreateObject("OpScrUtil.Utility")
strEnvValue =
objUtil.ExpandEnvironmentStrings("%PROGRAMFILES%") ' must include
the "%"
Set objUtil = Nothing
GetProgramFolder = strEnvValue
End Function
Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1
Utility Object, GetEnviron Method
Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.