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 |
|
|
|
|
|
reference |
05/31/2018 |
Disables monitoring on a particular drive.
uint32 Disable(
[in] String Drive
);
-
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.
If the method succeeds, the return value is S_OK. Otherwise, the method returns one of the COM error codes defined in WinError.h.
'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
Requirement | Value |
---|---|
Minimum supported client |
Windows XP [desktop apps only] |
Minimum supported server |
None supported |
Namespace |
Root\Default |
MOF |
|