rich2323 Posted February 16, 2015 Posted February 16, 2015 (edited) 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 February 16, 2015 by rich2323
rich2323 Posted February 16, 2015 Author Posted February 16, 2015 Well, it looks like this VBS script does not work. Anyone else had succuss changing the MAX usage using Autoit? Rich
Spider001 Posted February 16, 2015 Posted February 16, 2015 (edited) On xp i always do this with the registerkeys See microsoft site for keys Edited February 16, 2015 by Spider001
JohnOne Posted February 16, 2015 Posted February 16, 2015 Would it not just be adding $obj_SR.DrivePercent = 10 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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