Sign in to follow this  
Followers 0
Venom007

Create a System Restore Point

3 posts in this topic

#1 ·  Posted (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   ;==>_CreateRestorePoint

Credit goes to bchris01 for the updated code.

Edited by Venom007

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by bchris01

Share this post


Link to post
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.

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  
Followers 0