Jump to content

Any way to check if System Restore is disabled?


Xander
 Share

Recommended Posts

I've got a script that I run at almost every computer I touch. One of the little things it does is warn me if an XP system hasn't been updated to SP2.

I'd like to also add in a section where it checks that SysRestore is not disabled.

Any leads?

Link to comment
Share on other sites

I've got a script that I run at almost every computer I touch. One of the little things it does is warn me if an XP system hasn't been updated to SP2.

I'd like to also add in a section where it checks that SysRestore is not disabled.

Any leads?

control panel\system there is a tab of is

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Link to comment
Share on other sites

Thanks. I'm sure we all know that.

Since this is an Auto-It forum, I guess I assumed that it would be assumed that my question would be relevant to Auto-It.

I will rephrase: Is there any way for Auto-It to determine if System Restore is en/disabled?

Checking the reg? An obscure variable?

EDIT:

I've found "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore"

DisableSR is the on/off indicator.

(But MS cautions, btw, not to turn SR off from the reg as it doesn't delete the saved points. ...which is fine, 'cause I just want to have the script warn me of its status)

Edited by Xander
Link to comment
Share on other sites

  • Moderators

Try this:

$SysRst = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore", "DisableSR")
If @error Then MsgBox(0, "System Restore Check", "Troubles reading the registry.")
If $SysRst == 1 Then MsgBox(0, "System Restore Check", "System Restore is disabled")
If $SysRst == 0 Then MsgBox(0, "System Restore Check", "System Restore is enabled")
Edited by big_daddy
Link to comment
Share on other sites

Since this is an Auto-It forum, I guess I assumed that it would be assumed that my question would be relevant to Auto-It.

I will rephrase: Is there any way for Auto-It to determine if System Restore is en/disabled?

Checking the reg? An obscure variable?

...and just how is rudika's answer not "relevant to Auto-It"?

Don't be rude... be clear in your original post! State that you did not want any windows to appear.

rudika's answer can be scripted via AutoIt:

Run("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,4", "", @SW_HIDE)
WinWait("System Properties", "System Restore can")
If ControlCommand("System Properties", "System Restore can", "Button1", "IsChecked", "") Then
    MsgBox(0, "AutoIt", "System Restore is disabled.")
Else
    MsgBox(0, "AutoIt", "System Restore is enabled.")
EndIf
Not that you wanted this code, but if you test it and decide to hide the System Properties window, be sure and close it when you are finished with it...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Thanks. I'm sure we all know that.

Since this is an Auto-It forum, I guess I assumed that it would be assumed that my question would be relevant to Auto-It.

I will rephrase: Is there any way for Auto-It to determine if System Restore is en/disabled?

Checking the reg? An obscure variable?

moin, moin... :lmao:!

Sorry, but I didn´t believe I had to before-chew it you, and I only answered your question. So this would be my way, maybe you think it´s primitively, but I know it´s effectively. Of course you have to modify it to your system language.

CODE

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore", "DisableSR")
If $var = 1 Then
    MsgBox(4096, "System Restore Status:", "disabled")
Else
    Run("cmd /c " & @SystemDir & "\sysdm.cpl", "", @SW_HIDE)
    WinWaitActive("Systemeigenschaften", "")
    Send("{TAB 3}{UP}!a{ENTER}{ENTER}")
EndIf

That will deactivate the system restore.

Edited by rudika

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...