Microsoft Operations Manager

ExpandEnvironmentStrings Method

The ExpandEnvironmentStringsmethod expands environment-variable strings to their defined values.

[VBScript]
Utility.ExpandEnvironmentStrings(Instring Variant)

Parameters

Instring
Specifies the name of the environment variable to be expanded. The name must be preceded and followed by the percent character (%).

Return Value

String

Examples

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

Requirements

Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1

See Also

Utility Object, GetEnviron Method


Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.