SystemRestoreConfig 類別
提供屬性,以控制排程還原點建立的頻率,以及每個磁片磁碟機上耗用的磁碟空間量。
語法
class SystemRestoreConfig
{
uint32 RPSessionInterval;
uint32 RPGlobalInterval;
uint32 RPLifeInterval;
uint32 DiskPercent;
};
成員
SystemRestoreConfig 類別具有下列類型的成員:
屬性
SystemRestoreConfig 類別具有這些屬性。
-
DiskPercent
-
-
資料類型: uint32
-
存取類型:唯讀
系統還原可使用之每個磁片磁碟機上的磁碟空間數量上限。 此值會指定為總磁片磁碟機空間的百分比。 預設值為 12%。
Windows Vista: 從磁片區陰影複製服務 (VSS) 接收值。 這是系統還原可以使用的每個磁片磁碟機上的最大磁碟空間量。 預設值為總磁片磁碟機空間的 15%,或可用可用空間的 30%,以較小者為准。
-
-
RPGlobalInterval
-
-
資料類型: uint32
-
存取類型:唯讀
建立排程系統檢查點的絕對時間間隔,以秒為單位。 預設值為 86,400 (24 小時)。
Windows Vista: 從系統還原的工作排程器接收值。 如果工作已停用,則為零。
-
-
RPLifeInterval
-
-
資料類型: uint32
-
存取類型:唯讀
還原點保留的時間間隔,以秒為單位。 當還原點超過這個指定的間隔時,就會刪除它。 預設年齡限制為 90 天。
Windows Vista: 接收 UINTMAX 的值 。
-
-
RPSessionInterval
-
-
資料類型: uint32
-
存取類型:唯讀
在會話期間建立排程系統檢查點的時間間隔,以秒為單位。 預設值為零,表示功能已關閉。
Windows Vista: 如果系統還原已停用,則會收到零。
-
範例
不支援下列範例程式碼。 使用命令列工具 Vssadmin.exe 來變更保留磁片磁碟機空間的大小。
Windows XP: 支援此範例。
'The SystemRestoreConfig class provides properties for controlling the frequency of
'scheduled restore point creation and the amount of disk space consumed on each drive.
Set Args = wscript.Arguments
Set regSR = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestoreConfig='SR'")
If Args.Count() = 0 Then
Wscript.Echo "Usage: RegSR [RP{Session|Global|Life}Interval[=value]] [DiskPercent[=value]]"
Else
For i = 0 To Args.Count() - 1
Myarg = Args.Item(i)
Pos = InStr(Myarg, "=")
If Pos <> 0 Then
Myarray = Split(Myarg, "=", -1, 1)
myoption = Myarray(0)
value = Myarray(1)
Else
myoption = Myarg
End If
If myoption = "RPSessionInterval" Then
If Pos = 0 Then
Wscript.Echo "RPSessionInterval = " & regSR.RPSessionInterval
Else
regSR.RPSessionInterval = value
regSR.Put_
End If
ElseIf myoption = "RPGlobalInterval" Then
If Pos = 0 Then
Wscript.Echo "RPGlobalInterval = " & regSR.RPGlobalInterval
Else
regSR.RPGlobalInterval = value
regSR.Put_
End If
ElseIf myoption = "RPLifeInterval" Then
If Pos = 0 Then
Wscript.Echo "RPLifeInterval = " & regSR.RPLifeInterval
Else
regSR.RPLifeInterval = value
regSR.Put_
End If
ElseIf myoption = "DiskPercent" Then
If Pos = 0 Then
Wscript.Echo "DiskPercent = " & regSR.DiskPercent
Else
regSR.DiskPercent = value
regSR.Put_
End If
End If
Next
End If
需求
需求 | 值 |
---|---|
最低支援的用戶端 |
Windows XP [僅限傳統型應用程式] |
最低支援的伺服器 |
不支援 |
Namespace |
Root\Default |
MOF |
|