Sign in to follow this  
Followers 0
engjcowi

Code to check if system restore is active or disabled

5 posts in this topic

Hi guys

im trying to find some code that can access WMI or the registry to see if system restore is active or not? Im trying to write a program to self check.

Thanks

jamie

0

Share this post


Link to post
Share on other sites

im trying to find some code that can access WMI or the registry to see if system restore is active or not? Im trying to write a program to self check.

A lot depends on the code you are writing (script or program) and what you are doing with that code. If you are doing other things with system restore, the easiest is to check for the error ERROR_SERVICE_DISABLED on your first call to one of the SRCLIENT.DLL routines.

Otherwise, you can check for the status of the System Restore Service (srservice), and return an error if the service is not started, since this is how system restore works. For WMI, you can interrogate Win32_Service (http://msdn.microsoft.com/en-us/library/aa394418%28v=vs.85%29.aspx). For regular Win32 API, you can use QueryServiceConfig of the windows service API (http://msdn.microsoft.com/en-us/library/ms685942%28v=VS.85%29.aspx).

0

Share this post


Link to post
Share on other sites

Hi

thanks for your input. Theres a few good suggestions to get me started. Im going to write this in autoit as a self check to ensure its enabled on the comp as part of my analysis package.

jamie

0

Share this post


Link to post
Share on other sites

# 4 autoit code seems simple enough

HI

Thanks for you assitance geej. Ive got that code already which is great but it only works in xp as those reg flags are not there in vista or 7.

Thanks again

Jamie

0

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

  • Recently Browsing   0 members

    No registered users viewing this page.