Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Restore Point from .bat file?  (Read 7266 times)

0 Members and 1 Guest are viewing this topic.

Doc16743

    Topic Starter


    Rookie

    Restore Point from .bat file?
    « on: April 05, 2011, 04:45:55 AM »
    Under Windows 7 Home Premium 64-bit, does anyone know if it's possible to create a restore point from a batch file? I run the same batch file at least once a day and would be very convenient to create a retore point at the same time.

    Thanks in advance!

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Restore Point from .bat file?
    « Reply #1 on: April 06, 2011, 07:09:51 AM »
    You'll need a VBScript to do the heavy lifting, but you can use a batch file wrapper if needed:

    Code: [Select]
    Set sr = GetObject("winmgmts:\\.\root\default:Systemrestore")
    If (sr.CreateRestorePoint("My Daily Restore Point", 0, 100)) <> 0 Then
      MsgBox "My Daily Restore Point Failed!"
    End If

    Save the script with a VBS extension. It can be run at the command line or from a separate batch file using this notation:

    cscript scriptname.vbs

    You may have to insert path information for the script location.

    Good luck. 8)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein