SystemRestore class
Applies to: desktop apps only
Provides methods for disabling and enabling monitoring, listing available restore points, and initiating a restore on the local system.
Syntax
class SystemRestore
{
String Description;
uint32 RestorePointType;
uint32 EventType;
uint32 SequenceNumber;
String CreationTime;
};
Members
The SystemRestore class has these types of members:
Methods
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. |
Properties
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.
- RestorePointType
-
- Data type: uint32
- Access type: Read/write
The type of restore point. This member can be one of the following values.
- SequenceNumber
-
- Data type: uint32
- Access type: Read/write
- Qualifiers: Key
The sequence number of the restore point.
Remarks
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.
Examples
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
Requirements
|
Minimum supported client | Windows XP |
|---|---|
|
Minimum supported server | None supported |
|
Namespace |
\\.\Root\Default |
|
MOF |
|
See also
Send comments about this topic to Microsoft
Build date: 2/3/2012
[tfl - 24 10 09] Hi - and thanks for your post. You should post questions like this to the MSDN Forums at http://forums.microsoft.com/msdn or the MSDN Newsgroups at
http://www.microsoft.com/communities/newsgroups/en-us/. You are much more likely get a quicker response using the forums than through the Community Content. For specific help about:
Visual Studio : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.vstudio%2C&
SQL Server : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.sqlserver%2C&
.NET Framework : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.dotnet.framework
PowerShell : http://groups.google.com/group/microsoft.public.windows.powershell/topics?pli=1
All Public : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public%2C&
- 10/19/2009
- Missing information
- 10/24/2009
- Thomas Lee
[tfl - 24 10 09] Hi - and thanks for your post. You should post questions like this to the MSDN Forums at http://forums.microsoft.com/msdn or the MSDN Newsgroups at
http://www.microsoft.com/communities/newsgroups/en-us/. You are much more likely get a quicker response using the forums than through the Community Content. For specific help about:
Visual Studio : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.vstudio%2C&
SQL Server : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.sqlserver%2C&
.NET Framework : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.dotnet.framework
PowerShell : http://groups.google.com/group/microsoft.public.windows.powershell/topics?pli=1
All Public : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public%2C&
- 6/6/2009
- BryanLockwood
- 10/24/2009
- Thomas Lee