CreateRestorePoint method of the SystemRestore Class
Applies to: desktop apps only
Creates a restore point.
This method is the scriptable equivalent of the SRSetRestorePoint function.
Syntax
uint32 CreateRestorePoint( [in] String Description, [in] uint32 RestorePointType, [in] uint32 EventType );
Parameters
- Description [in]
-
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.
- RestorePointType [in]
-
The type of restore point. This member can be one of the following values.
- EventType [in]
-
The type of event. This member can be one of the following values.
Return value
If the method succeeds, the return value is S_OK. Otherwise, the method returns one of the COM error codes defined in WinError.h.
Examples
'CreateRestorePoint Method of the SystemRestore Class 'Creates a restore point. Specifies the beginning and 'the ending of a set of changes so that System Restore 'can create a restore point.This method is the 'scriptable equivalent of the SRSetRestorePoint function. Set Args = wscript.Arguments If Args.Count() > 0 Then RpName = Args.item(0) Else RpName = "Vbscript" End If Set obj = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore") If (obj.CreateRestorePoint(RpName, 0, 100)) = 0 Then wscript.Echo "Success" Else wscript.Echo "Failed" End If
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