• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1464
  • Last Modified:

VBscript - Set System Restore settings Win 7

Does anyone know of or can create a script that can be deployed using group policy to turn on system restore on a data partition (eg. D: ) for Windows 7 computers? What I would like is to to turn on System Restore on the data partition to "Only restore previous versions of files" and use up 5% of disk space.

Thanks guys!

IV
0
Ivano Viola
Asked:
Ivano Viola
  • 4
  • 2
1 Solution
 
RobSampsonCommented:
Hi, this will show you how to configure System Restore:
http://www.activexperts.com/network-monitor/windowsmanagement/scripts/desktop/system/

Down the bottom there's code to change the configuration of it.

Regards,

Rob.
0
 
Ivano ViolaSystem AdministratorAuthor Commented:
Rob,

I did come across that site you posted the other day. It doesn't really tell me how to turn on System Restore and set it to "Only restore previous versions of files".

Thanks,
IV
0
 
RobSampsonCommented:
OK, well this will enable system restore on drive D and set it to use 5 percent.   As yet, I haven't found a way to select "Only restore previous versions of files" and from what I've read you can't change that programatically.

I'm still looking around at possible registry changes....

Rob.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default")

Set objItem = objWMIService.Get("SystemRestore")
errResults = objItem.Enable("D:")

Set objConfig = objWMIService.Get("SystemRestoreConfig='SR'")
objConfig.DiskPercent = 5
objConfig.Put_

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
RobSampsonCommented:
OK, test this too, but please back up the following registry key first:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SPP\Clients\

by right clicking that key and selecting Export.

Then within that key, you should see a REG_MULTI_SZ value with a name of
{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513}

Delete that value, and check your System Restore settings again.  It worked for me.  Then, when I added the backed up registry values back in, the setting for "Restore system settings and previous versions of files" was selected again.

The tricky part would be knowing what to add back into that if you wanted to enable it again.  You might just get away with disabling, then re-enabling system restore, but I haven't tried that.

Regards,

Rob.
0
 
Ivano ViolaSystem AdministratorAuthor Commented:
The reg key didn't work but that's fine. Not sure why they don't add more settings for System Restore in group policy. You can pretty much just turn it off or on. Not much on the Internet regarding "Only restore previous versions of files".

I appreciate the help. Thanks again!

IV
0
 
RobSampsonCommented:
OK, thanks for the grade anyway.  It would be nice if they allowed more scriptable configuration, though!

Rob.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now