topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 7:58 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: SOLVED: Script to set a system restore point; win7  (Read 10953 times)

benhenry

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 4
    • View Profile
    • Donate to Member
SOLVED: Script to set a system restore point; win7
« on: July 14, 2010, 03:41 PM »
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

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Script to set a system restore point; win7
« Reply #1 on: July 14, 2010, 06:58 PM »
This one looks like it has the bases covered:

http://www.winhelpon...ploads/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.
« Last Edit: July 14, 2010, 07:12 PM by MilesAhead »

benhenry

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 4
    • View Profile
    • Donate to Member
Re: IDEA: Script to set a system restore point; win7
« Reply #2 on: July 14, 2010, 07:32 PM »
Thank you! Works perfectly. I'm a single parent with teenagers.
System restore points are a necessity.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Script to set a system restore point; win7
« Reply #3 on: July 14, 2010, 07:36 PM »
I'm a single parent with teenagers.
System restore points are a necessity.

 ;D ;D ;D

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

parkint

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 119
  • It's bad luck to be superstitious
    • View Profile
    • Donate to Member
Re: IDEA: Script to set a system restore point; win7
« Reply #4 on: July 14, 2010, 08:47 PM »
This one looks like it has the bases covered:

http://www.winhelpon...ploads/createsrp.vbs

Wonderful goodness.