Disable 方法 SystemRestore 類別

停用特定磁片磁碟機上的監視。

語法

uint32 Disable(
  [in] String Drive
);

參數

磁片磁碟機 [in]

要停用的磁片磁碟機。 磁片磁碟機字串的格式應該是 「C:\」。 如果此參數是系統磁片磁碟機或空字串 (「」) ,則不會監視任何磁片磁碟機。

傳回值

如果方法成功,傳回值會S_OK。 否則,方法會傳回 WinError.h 中定義的其中一個 COM 錯誤碼。

範例

'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

規格需求

需求
最低支援的用戶端
Windows XP [僅限傳統型應用程式]
最低支援的伺服器
都不支援
命名空間
Root\Default
MOF
Sr.mof

另請參閱

SystemRestore