Venom007 Posted July 8, 2009 Share Posted July 8, 2009 (edited) Just simply create a system restore point:_CreateRestorePoint('Test Restore') If Not @error Then MsgBox(0x40, "System Restore!", "System Restore Point created successfully.", 20) Func _CreateRestorePoint($sRestorePointName) Local $objSystemRestore $objSystemRestore = ObjGet("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore") If Not $objSystemRestore.createrestorepoint($sRestorePointName, 0, 100) = 0 Then SetError(1) EndFunc ;==>_CreateRestorePointCredit goes to bchris01 for the updated code. Edited July 8, 2009 by Venom007 Link to comment Share on other sites More sharing options...
Beege Posted July 8, 2009 Share Posted July 8, 2009 (edited) Hey thats a great example. Good job! I made it into a function since it wasnt quite complete. _CreateRestorePoint('Test Restore') If Not @error Then MsgBox(0x40, "System Restore!", "System Restore Point created successfully.", 20) Func _CreateRestorePoint($sRestorePointName) Local $objSystemRestore $objSystemRestore = ObjGet("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore") If Not $objSystemRestore.createrestorepoint($sRestorePointName, 0, 100) = 0 Then SetError(1) EndFunc ;==>_CreateRestorePoint Edited July 8, 2009 by bchris01 Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
Venom007 Posted July 8, 2009 Author Share Posted July 8, 2009 Hey thats a great example. Good job! I made it into a function since it wasnt quite complete. _CreateRestorePoint('Test Restore') If Not @error Then MsgBox(0x40, "System Restore!", "System Restore Point created successfully.", 20) Func _CreateRestorePoint($sRestorePointName) Local $objSystemRestore $objSystemRestore = ObjGet("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore") If Not $objSystemRestore.createrestorepoint($sRestorePointName, 0, 100) = 0 Then SetError(1) EndFunc ;==>_CreateRestorePoint Thanks, I like the function. I will update the original post. Input always welcome. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now