Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Code to check if system restore is active or disabled

- - - - -

  • Please log in to reply
4 replies to this topic

#1
engjcowi

engjcowi

    Newbie

  • Member
  • 42 posts
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


How to remove advertisement from MSFN

#2
Glenn9999

Glenn9999

    Senior Member

  • Member
  • PipPipPipPip
  • 660 posts
  • OS:Windows 8 x64
  • Country: Country Flag

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.microsof...8(v=vs.85).aspx). For regular Win32 API, you can use QueryServiceConfig of the windows service API (http://msdn.microsof...2(v=VS.85).aspx).

#3
engjcowi

engjcowi

    Newbie

  • Member
  • 42 posts
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

#4
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • OS:XP Pro x86
  • Country: Country Flag
# 4 autoit code seems simple enough

#5
engjcowi

engjcowi

    Newbie

  • Member
  • 42 posts

# 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 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN