System.SetRestorePoint

number System.SetRestorePoint (

number EventType,

number RestorePointType,

number SequenceNum,

string Description )

Description

Creates a system restore point on the computer and returns the sequence number that was used.

To create a proper restore point, this action needs to be called twice. The first time, EventType should be set to SYSTEM_CHANGE_BEGIN. The second time, EventType should be set to SYSTEM_CHANGE_END.

Note: This system restore action is only supported on Windows XP or later and may require administrative privileges. You can use the System.IsSystemRestoreAvailable action to determine whether or not the system restore service is available.

System Restore does not restore user data or documents, so it will not cause users to lose their files, e-mail, browsing history, or favorites. Only certain file types are monitored by system restore. See the System Restore Monitored File Extensions topic for details. System Restore also saves a full snapshot of the registry.

Parameters

EventType

(number) The type of event for system restore. Choose from:

CONSTANT

VALUE

DESCRIPTION

SYSTEM_CHANGE_BEGIN

100

Notify that a system change has begun.

SYSTEM_CHANGE_END

101

Notify that a system change has ended.

RestorePointType

(number) The type of restore point to set. Choose from:

CONSTANT

VALUE

DESCRIPTION

SYS_RESTORE_APP_INSTALL

0

The restore point wraps an application install.

SYS_RESTORE_APP_UNINSTALL

1

The restore point wraps an application uninstall.

SYS_RESTORE_APP_DDRIVER_INSTALL

10

The restore point wraps a device driver install.

SYS_RESTORE_MODIFY_SETTINGS

12

The restore point wraps the modifications of an application's settings. (Only System Restore monitored file extensions are restored)

SYS_RESTORE_CANCELLED_OPERATION

13

The operation that the restore point was set to wrap has been canceled. As a result the restore point needs to be deleted. For example, an install would use this flag when a user cancels the installation.

Note:
You can delete a restore point using the System.RemoveRestorePoint action.

SequenceNum

(number) The sequence number of the restore point. When calling this action with the EventType set to SYSTEM_CHANGE_BEGIN, pass 0 as this parameter. This will cause the action to return the sequence number of the restore point that has been created. Use that sequence number in all subsequent calls to any restore point actions.

Description

(string) The description of the restore point that will show in Microsoft's System Restore utility. A maximum of 64 characters can be used.

Returns

(number) Returns the sequence number that was used to create the system restore point. You can use Application.GetLastError to determine whether this action failed, and why.

ResultVariable

When adding an action with the action editor, you can use this field to specify a variable that the return value will be stored in.

See also: Related Actions