Jump to content

System Restore Point Creator


Pakku
 Share

Recommended Posts

Hi all,

The one of use who use Vista (and I am one of them) have noticed that Vista uses the hard disk very much (to much). This is caused by the fact that Vista is (almost) constantly making system restore points. So to reduce the noice of your pc it is enought to disable system restore, but there you have our first problem: systemrestore is in some situation handful and by disabling this, you don't have a save feeling about your system.

So this is what I made: :D

#include<GUIConstants.au3>

$disable = True ;set True to disable systemrestore after creating a restore point and False to keep systemrestore enabled

Opt("TrayMenuMode",1)

$create = TrayCreateItem("Create")
TrayCreateItem("")
$exit = TrayCreateItem("Exit")
TraySetState()

$gui = GUICreate("Create System Restore Point",176,21,@DesktopWidth - 176,@DesktopHeight - 80,$WS_POPUP,$WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
$input = GUICtrlCreateInput("",0,0,150,21)
$send = GUICtrlCreateButton("OK",150,0,26,21)
GUISetState(@SW_HIDE,$gui)

While 1
    $tray_msg = TrayGetMsg()
    $gui_msg = GUIGetMsg()
    Select
        Case $tray_msg = $create
            GUICtrlSetData($input,"RestorePoint " & @HOUR & ":" & @MIN & ":" & @SEC)
            GUISetState(@SW_SHOW,$gui)
        Case $tray_msg = $exit
            Exit
        Case $gui_msg = $send
            If StringLen(GUICtrlRead($input)) > 0 Then
                GUISetState(@SW_HIDE,$gui)
                _CreateSystemRestorePoint(GUICtrlRead($input),$disable)
            Else
                GUISetState(@SW_HIDE,$gui)
            EndIf       
    EndSelect
WEnd

Func _CreateSystemRestorePoint($discription,$disable = True)
    #RequireAdmin
    $obj = ObjGet("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")
    $obj.Enable("")
    $obj.CreateRestorePoint($discription, 12, 100)
    If $disable Then
        $obj.Disable("")
    EndIf
EndFunc

To do:

- let script notice if UAC (User Account Control) is popping up and user allows Administrator priviliges ==> script creates automaticly system restore point (HELP PLEASE!) :)

Bugs known:

- by disabling systemrestore in XP, it deletes all restorepoint (in Vista the restorepoints are kept)

As you can see, this script is especially made for Vista users, although it might be useful for XP users

:D

p.s. some feedback is welcome :D

Edited by Pakku
Link to comment
Share on other sites

To do:

- let script notice if UAC (User Account Control) is popping up and user allows Administrator priviliges ==> script creates automaticly system restore point (HELP PLEASE!) :)

#RequireAdmin directive if needed.

I always turn off system restore as I have had issues in the past with it and my system drive seems to never needs constant defraging when it is off. Keeps me happy.

Link to comment
Share on other sites

  • 10 months later...

This is a good tool! I wish I thought of looking here first before I installed 22 Vista updates one by one!

One thing I would like to see and I don't have a clue how to do this is have it popup when it's though creating the restore point.

-= Smudley =-
Link to comment
Share on other sites

#RequireAdmin directive if needed.

I always turn off system restore as I have had issues in the past with it and my system drive seems to never needs constant defraging when it is off. Keeps me happy.

I'm baffled. I'm running Vista Home Premium 32 bit and I've tried a bunch of scripts to create a restore point. I got

a .vbs script to work a couple of times by turning on every service under the sun. For some reason I haven't fathomed it seems to be impossible to backtrack one by one to figure out which services have to be enabled and running. (Turn them off one by one, try the script, when it no longer works, turn the last service you turned off back on.. should work right? Nope!!) As one might expect, the .vbs scripts I've tried work first time every time in XP. :)

Anyway, this one fails too. The .vbs scripts give Provider Load Error 0x80041013(I even have the HRESULT memorized). It's too bad because I dual-boot XP and it keeps erasing my restore points. It would be nice if I could just double click to create a Vista restore point instead of using the Applet thing.

One of the mysteries is why can I create the Restore Point using the Applet thing in My Computer but none of the WMI scripts will do it? Strange!

Didn't mean to hijack the thread... just thought someone might have detailed knowledge of Vista Restore Point quirks. :)

Edited by MilesAhead
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...