engjcowi Posted December 15, 2010 Share Posted December 15, 2010 Hi guysim 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.Thanksjamie Link to comment Share on other sites More sharing options...
Glenn9999 Posted December 15, 2010 Share Posted December 15, 2010 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). Link to comment Share on other sites More sharing options...
engjcowi Posted December 15, 2010 Author Share Posted December 15, 2010 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 Link to comment Share on other sites More sharing options...
Geej Posted December 19, 2010 Share Posted December 19, 2010 # 4 autoit code seems simple enough Link to comment Share on other sites More sharing options...
engjcowi Posted December 19, 2010 Author Share Posted December 19, 2010 # 4 autoit code seems simple enoughHI 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 againJamie Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now