Solved

VBscript - Set System Restore settings Win 7

Posted on 2011-09-26
6
1,326 Views
Last Modified: 2012-05-12
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
Comment
Question by:ivanoviola
  • 4
  • 2
6 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 36694462
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
 
LVL 21

Author Comment

by:ivanoviola
ID: 36712672
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
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 36714012
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 65

Expert Comment

by:RobSampson
ID: 36714077
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
 
LVL 21

Author Closing Comment

by:ivanoviola
ID: 36817347
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
 
LVL 65

Expert Comment

by:RobSampson
ID: 36818657
OK, thanks for the grade anyway.  It would be nice if they allowed more scriptable configuration, though!

Rob.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Welcome to part one of a multi-part tutorial series, VBScript for Windows System Administrators.  The goal of this series is to teach non-programmers how to write useful VBS code to automate their environment, and perform tasks faster, and in a more…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now