Skip to content

Latest commit

 

History

History
102 lines (63 loc) · 2 KB

disable-systemrestore.md

File metadata and controls

102 lines (63 loc) · 2 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
Disable method of the SystemRestore class
Disables monitoring on a particular drive.
2ad37dd4-7d80-4697-9dbb-abb329a34ff7
Disable method System Restore
Disable method System Restore , SystemRestore class
SystemRestore class System Restore , Disable method
apiref
SystemRestore.Disable
Root\Default
COM
reference
05/31/2018

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

Requirement Value
Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
None supported
Namespace
Root\Default
MOF
Sr.mof

See also

SystemRestore