The VBScript function in this script can be used to automatically create a system restore point. Could be useful at the start of a script that makes significant changes to the system, such as at the start of an installation routine.
VBSTART
Function MakeRestorePoint
Set rp = getobject("winmgmts:\\.\root\default:Systemrestore")
msg = "New Restore Point successfully created." & vbCR
msg = msg & "It is listed as: " & vbCR
msg = msg & "Automatic Restore Point " & Date & " " & Time
If (rp.createrestorepoint("Automatic Restore Point", 0, 100)) = 0 Then
MakeRestorePoint = msg
Else
MakeRestorePoint = "Restore Point creation Failed!"
End If
Set sr = Nothing
End Function
VBEND
VBEval>MakeRestorePoint,msg
MessageModal>msg
Automatically Create a System Restore Point
Moderators: Dorian (MJT support), JRL, Phil Pendlebury
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Automatically Create a System Restore Point
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?