Jump to content

Create a System Restore Point


Venom007
 Share

Recommended Posts

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   ;==>_CreateRestorePoint

Credit goes to bchris01 for the updated code.

Edited by Venom007
Link to comment
Share on other sites

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 by bchris01
Link to comment
Share on other sites

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

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...