Wednesday, February 1, 2012

Create a System Restore Point Using PowerShell.

 

Hi,

Today i was testing some scripts for un-installation of one of our software and i want to create a “System Restore Point” before doing so. In previous days i used some “VB Script” to create a system restore point. But now i know that “PowerShell” can do this, i search for the CMDLET which can do this and i found it.

Currently if we need to create a restore point we need to , Click on “Start”, Click on “All Programs”, Click on “Accessories”, click on “System Tools” and then select “System Restore”.

Pooh!!!! time consuming”

Lets do it using PowerShell and the cmdlet which create a “System Restore Point” is “Checkpoint-Computer

Note: Make Sure you run PowerShell as "Administrator” other wise it give you “Access Denied

01-02-2012 18-08-30

Lets Start.

Run PowerShell as Administrator.

01-02-2012 18-09-32

Type the below command .

In –Description you can provide  a relevant info about the restore point and by default  -RestorePointType type is Application_Install and the other Valid values are , APPLICATION_UNINSTALL, DEVICE_DRIVER_INSTALL, MODIFY_SETTINGS, and CANCELLED_OPERATION.

Checkpoint-Computer -Description "Uninstall Software using Script" -RestorePointType "APPLICATION_UNINSTALL" –Verbose

You ca see it creating the restore point ….

01-02-2012 18-15-20 

When it finish done creating the restore point it come back to the PS Prompt.

Let Cross-Check that it created the restore point or not.

Open the “System Restore

01-02-2012 18-15-53 

Click on “Next”

01-02-2012 18-16-34 

and “here is the “Restore Point” which is created by us using PowerShell..

01-02-2012 18-17-12

Cool !!!! isnt ..

Thanks for reading…

Aman Dhally

Aman Dhally 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.