ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

SOLVED: Script to set a system restore point; win7

(1/1)

benhenry:
This is my first visit here... what a groovy place!

I got two vb scripts that set a system restore point in win7 (from a place called "lifehacker")

The first one sets the restore point with a label that is supplied from a message box:

If WScript.Arguments.Count = 0 Then
   Set objShell = CreateObject("Shell.Application")
   objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1
Else
   GetObject("winmgmts:\\.\root\default:Systemrestore").CreateRestorePoint InputBox("Enter a descriptive name for the restore point:","Create Restore Point - With Description"), 0, 100
End If

The second one sets the restore point with a preset label, in this case, "manual restore point":

If WScript.Arguments.Count = 0 Then
   Set objShell = CreateObject("Shell.Application")
   objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1
Else
   GetObject("winmgmts:\\.\root\default:Systemrestore").CreateRestorePoint "Manual Restore Point", 0, 100
End If

Is there a way to combine these two so that if I "cancel" the message box on the first one...
without typing a label; it will simply run the other one to create the restore point with the preset label?

Thanks if you can help.. Ben

MilesAhead:
This one looks like it has the bases covered:

http://www.winhelponline.com/blog/wp-content/uploads/createsrp.vbs

edit: btw if you want a different default string, just change "Manual Restore Point" to "my default string".  This way you can still back out by pressing Cancel.

benhenry:
Thank you! Works perfectly. I'm a single parent with teenagers.
System restore points are a necessity.

mouser:
I'm a single parent with teenagers.
System restore points are a necessity.
--- End quote ---

 ;D ;D ;D

setting up a good external backup system would probably be a good idea too.

parkint:
This one looks like it has the bases covered:

http://www.winhelponline.com/blog/wp-content/uploads/createsrp.vbs

-MilesAhead (July 14, 2010, 06:58 PM)
--- End quote ---
Wonderful goodness.

Navigation

[0] Message Index

Go to full version