Export (0) Print
Expand All

Disable method of the SystemRestore class

Disables monitoring on a particular drive.

Syntax


uint32 Disable(
  [in]  String Drive
);

Parameters

Drive [in]

The drive to be disabled. The drive string should be of the form "C:\". If this parameter is the system drive or an empty string (""), no drives are monitored.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the method returns one of the COM error codes defined in WinError.h.

Examples


'Disable Method of the SystemRestore Class
'Disables monitoring on a particular drive.
Set Args = wscript.Arguments
If Args.Count() > 0 Then
    Drive = Args.item(0)
Else
    Drive = ""
End If

Set obj = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")

If (obj.Disable(Drive)) = 0 Then
    wscript.Echo "Success"
Else 
    wscript.Echo "Failed"
End If


Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

None supported

Namespace

Root\Default

MOF

Sr.mof

See also

SystemRestore

 

 

Community Additions

ADD
Show:
© 2015 Microsoft