Bookmark and Share

Author Topic: System Restore  (Read 13366 times)

0 Members and 1 Guest are viewing this topic.

Offline kayslover

  • PcWinTech Jr. Member
  • Join Date: Mar 2014
  • Posts: 4
  • Karma: 0
System Restore
« on: March 22, 2014, 08:54:57 AM »
Running XP, SP3.

I have various internal and external drives attached to my PC. On a weekly basis I back up my drive, but before i do that I switch of system restore on all drive. Once all backups have completed, I switch on system restore, and it enables it on all drive, I personally go into settings and switch off system restore on all but the C drive.

Is there a way to automate (via a script that I can put it in start up program) that would only set up a system restore on the C drive only?

I have a script that already take a system restore point on the C drive when system restore is enabled.

Any help welcome.

PcWinTech.com Forums

System Restore
« on: March 22, 2014, 08:54:57 AM »

Offline Shane

  • Top Geek, err uh Dog.
  • PcWinTech Administrator
  • PcWinTech Guru
  • *******
  • Join Date: Jul 2008
  • Posts: 16,846
  • Location: USA
  • Karma: 523
  • "Knowledge should be shared not hidden."
Re: System Restore
« Reply #1 on: March 24, 2014, 11:45:57 AM »
You can do it with WMI and a vbs script.

Is a script to turn off system restore on the C: drive.

Code: [Select]
Drive = "C:\"

Set obj = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")

If (obj.Disable(Drive)) = 0 Then
    'wscript.Echo "Success"
Else
    'wscript.Echo "Failed"
End If

Shane
(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline kayslover

  • PcWinTech Jr. Member
  • Join Date: Mar 2014
  • Posts: 4
  • Karma: 0
Re: System Restore
« Reply #2 on: March 25, 2014, 05:08:31 AM »
Shane,

Firstly, many thanks for your assistance.

Your script is to turn off system restore which I can use as a scheduled task to turn off system restore on the C drive before I do the weekly backups..

Is there any way I can have a script which I will use as a schedules task to turn on system restore just on the C drive. All other drives do not need system restore.

Thanks.

Offline Shane

  • Top Geek, err uh Dog.
  • PcWinTech Administrator
  • PcWinTech Guru
  • *******
  • Join Date: Jul 2008
  • Posts: 16,846
  • Location: USA
  • Karma: 523
  • "Knowledge should be shared not hidden."
Re: System Restore
« Reply #3 on: March 25, 2014, 10:39:57 AM »
Yeah, same script just change

obj.Disable(Drive)
to
obj.Enable(Drive)

 :wink:

Shane
(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline kayslover

  • PcWinTech Jr. Member
  • Join Date: Mar 2014
  • Posts: 4
  • Karma: 0
Re: System Restore
« Reply #4 on: March 26, 2014, 06:35:02 AM »
Thanks Shane

Offline kayslover

  • PcWinTech Jr. Member
  • Join Date: Mar 2014
  • Posts: 4
  • Karma: 0
Re: System Restore
« Reply #5 on: March 28, 2014, 04:19:10 AM »
Shane,

I have had the chance to run the scripts and note that the one to switch on system restore on just the C drive, is actually switching on system restore on ALL drives. I note that the script does have a pointer to the C drive, but it does all of them.

FYI When I go into My Computer, my C Drive shows as Main Drive (C:), as that is what I have decided to call it.

I have changed the script to replace Drive = "C:\" as Drive = “Main Drive:” and it still doesn’t work.

Any idea on how to enable system restore on just the C drive?

Thanks

Offline Shane

  • Top Geek, err uh Dog.
  • PcWinTech Administrator
  • PcWinTech Guru
  • *******
  • Join Date: Jul 2008
  • Posts: 16,846
  • Location: USA
  • Karma: 523
  • "Knowledge should be shared not hidden."
Re: System Restore
« Reply #6 on: March 28, 2014, 10:40:27 AM »
That is the only script I have found that works with the system restore. I dont know why it is doing it to them all when you are telling it just the C:\ drive. And you always use the drive letter not the drive name.

You could just add to the script to disable the other drives after and see if that works.

Shane
(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

PcWinTech.com Forums

Re: System Restore
« Reply #6 on: March 28, 2014, 10:40:27 AM »