Share via


VarSet.DumpToFile Method

Writes the contents of a VarSet object to a file.

 GetScriptState.GetScriptSet.DumpToFile(FileName String)

Parameters

  • FileName
    Specifies the name or path of the file used to store the VarSet values.

Return Value

None

Remarks

Unless the FileName parameter contains a complete folder path, the file will be created in the Microsoft Operations Manager 2005 folder.

Examples

The following example shows how to write the contents of the specified VarSet object to a file in the Microsoft Operations Manager 2005 folder.

Function SaveVarSetToFile(strVarSetName)
    Dim objScriptState
    Dim objVarSet
    Dim strFileName
    Dim dtmNow

    dtmNow = Now()

    strFileName = Month(dtmNow) & "_" & Day(dtmNow) & "_" & _
                  Hour(dtmNow) & "_" & Minute(dtmNow) & "_" & _
                  Second(dtmNow) & ".dat"

    Set objScriptState = ScriptContext.GetScriptState()
    Set objVarSet = objScriptState.GetSet(strVarSetName)
    Call objVarSet.DumpToFile(strFileName)

    Set objScriptState = Nothing
    Set objVarSet = Nothing

    SaveVarSetToFile = strFileName
End Function

Requirements

Platforms: Requires Windows 2000 or later

Version: Requires MOM 2000  or later

See Also

VarSet Object