Jump to content
Sign in to follow this  
Venom007

Create a System Restore Point

Recommended Posts

Venom007

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

Share this post


Link to post
Share on other sites
Beege

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

Share this post


Link to post
Share on other sites
Venom007

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.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.