Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



Sign in to follow this  
engjcowi

Code to check if system restore is active or disabled

Recommended Posts

engjcowi    0

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

Share this post


Link to post
Share on other sites

Glenn9999    6

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).

Share this post


Link to post
Share on other sites
engjcowi    0

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

Share this post


Link to post
Share on other sites
engjcowi    0

# 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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×