SystemRestore class
Provides methods for disabling and enabling monitoring, listing available restore points, and initiating a restore on the local system.
class SystemRestore
{
String Description;
uint32 RestorePointType;
uint32 EventType;
uint32 SequenceNumber;
String CreationTime;
};
The SystemRestore class has these types of members:
The SystemRestore class has these methods.
Method | Description |
---|---|
CreateRestorePoint | Creates a restore point. |
Disable | Disables monitoring on a particular drive. |
Enable | Enables monitoring on a particular drive. |
GetLastRestoreStatus | Retrieves the status of the last system restore. |
Restore | Initiates a system restore. |
The SystemRestore class has these properties.
-
CreationTime
-
-
Data type: String
-
Access type: Read/write
The time at which the state change occurred.
-
-
Description
-
-
Data type: String
-
Access type: Read/write
The description to be displayed so the user can easily identify a restore point. The maximum length of an ANSI string is MAX_DESC. The maximum length of a Unicode string is MAX_DESC_W. For more information, see Restore Point Description Text.
-
-
EventType
-
-
Data type: uint32
-
Access type: Read/write
The type of event. This member can be one of the following values.
Value Meaning - BEGIN_NESTED_SYSTEM_CHANGE
- 102
A system change has begun. A subsequent nested call does not create a new restore point.
Subsequent calls must use END_NESTED_SYSTEM_CHANGE, not END_SYSTEM_CHANGE.- BEGIN_SYSTEM_CHANGE
- 100
A system change has begun. - END_NESTED_SYSTEM_CHANGE
- 103
A system change has ended. - END_SYSTEM_CHANGE
- 101
A system change has ended. -
-
RestorePointType
-
-
Data type: uint32
-
Access type: Read/write
The type of restore point. This member can be one of the following values.
Value Meaning - APPLICATION_INSTALL
- 0
An application has been installed. - APPLICATION_UNINSTALL
- 1
An application has been uninstalled. - CANCELLED_OPERATION
- 13
An application needs to delete the restore point it created. For example, an application would use this flag when a user cancels an installation. - DEVICE_DRIVER_INSTALL
- 10
A device driver has been installed. - MODIFY_SETTINGS
- 12
An application has had features added or removed. -
-
SequenceNumber
-
-
Data type: uint32
-
Access type: Read/write
-
Qualifiers: Key
The sequence number of the restore point.
-
You can obtain a list of restore points by using the SWbemServices.InstancesOf method to retrieve a collection of SystemRestore objects. You can use the class properties to identify the restore point.
The following sample script enumerates the current restore points.
'SystemRestore Class
'Provides methods for disabling and enabling monitoring,
'listing available restore points, and initiating a
'restore on the local system.
Set RPSet = GetObject("winmgmts:root/default").InstancesOf ("SystemRestore")
for each RP in RPSet
wscript.Echo "Dir: RP" & RP.SequenceNumber & ", Name: " & RP.Description & ", Type: ", RP.RestorePointType & ", Time: " & RP.CreationTime
next
Requirement | Value |
---|---|
Minimum supported client |
Windows XP [desktop apps only] |
Minimum supported server |
None supported |
Namespace |
Root\Default |
MOF |
|