Click here to Skip to main content
12,395,946 members (64,409 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

11K views
2 bookmarked
Posted

Programmatically Create System Restore Point

, 6 Nov 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
System Restore is a powerful feature used in windows operating systems to create backups of the current system state before installation of custom software and critical system changes so that in case of an error, the user will be able to go back to the point just before the system was...
System Restore is a powerful feature used in windows operating systems to create backups of the current system state before installation of custom software and critical system changes so that in case of an error, the user will be able to go back to the point just before the system was changed.

Suppose you are developing a custom application and at a point in time your application needs to change some system settings. It would be a great idea if you can create a restore point from within your application without the need to notify the user to manually create a restore point.

To create a restore point from vb.net code, we will use the handy GetObject method to grab the system restore application and create an instance from it. Once we have a system restore variable in hand, we just need a call to CreateRestorePoint method passing in the name of the restore point. There are 2 more variables that you do not need to worry about, These are the RestorePointType and the EventType which have static values in most cases of 0 and 100 respectively. Note that the CreateRestorePoint method takes a few seconds to execute. Below is a simple implementation to create a test restore point:

the code is posted here http://alitarhini.wordpress.com/2010/10/31/programmatically-create-system-restore-point/[^]

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ali Tarhini
Software Developer (Senior) Microgen
Lebanon Lebanon
For more articles and extreme topics please check out my personal website www.alitarhini.com

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 6 Nov 2010
Article Copyright 2009 by Ali Tarhini
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid