Jump to content
Sign in to follow this  
rich2323

Turning on System Restore and configure

Recommended Posts

Hi,

So I am trying to setup System Restore on all my Windows 7 machines.  System restore was turned off before the imaging process and we now want to turn it back and configure it on each machine.

So for I have been able to turn using the following script to turn on System Restore:

_SR_Enable("C:\")

Func _SR_Enable($DriveL = $SystemDrive)
    If Not IsObj($obj_SR) Then $obj_SR = ObjGet("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")
    If Not IsObj($obj_SR) Then Return 0
    If $obj_SR.Enable($DriveL) = 0 Then Return 1
    Return 0
EndFunc

The issue is that when I use the above script, the system is set for 0% MAX disk space use, so I need to change the MAX Usage to 5%.

I have found this vbs code, but I am having a hard time converting this to autoit:

Const GLOBAL_INTERVAL_IN_SECONDS = 100000
Const LIFE_INTERVAL_IN_SECONDS = 8000000
Const SESSION_INTERVAL_IN_SECONDS = 500000
 
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\default")
Set objItem = objWMIService.Get("SystemRestoreConfig='SR'")
objItem.DiskPercent = 10
objItem.RPGlobalInterval = GLOBAL_INTERVAL_IN_SECONDS
objItem.RPLifeInterval = LIFE_INTERVAL_IN_SECONDS
objItem.RPSessionInterval = SESSION_INTERVAL_IN_SECONDS
objItem.Put_

Has anyone else configured System Restore ?

Thanks,

Rich

Edited by rich2323

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  

×
×
  • Create New...