Microsoft Operations Manager

ExpandEnvironmentStrings Method

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

Utility.ExpandEnvironmentStrings(Instring Variant)


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

Return Value



The following example shows how to get an expanded environment variable.

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

See Also

Utility Object, GetEnviron Method

Did you find this information useful? Please send your suggestions and comments about the documentation to