MSFN Forum: Help... can't turn SR with script - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help... can't turn SR with script

#1 User is offline   illusions 

  • Junior
  • Pip
  • Group: Members
  • Posts: 61
  • Joined: 18-September 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 11 August 2011 - 03:40 PM

Hi,

I would like to turn off system restore on c drive since it is ON by default on windows 7.

I have tried the following 2 vbs script found in the net

script 1 ------------------------------


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

Set objItem = objWMIService.Get("SystemRestore")
errResults = objItem.Disable("C:\")


script 2 ------------------------------

Dim SRP, eSRP
Set SRP = GetObject("winmgmts:\\.\root\default:SystemRestore")
eSRP = SRP.disable("C:\")


However, when i click control panel -- system -- advance system settings -- system protection -- c drive is still show "ON"

Please advice and thank you.

Attached File(s)

  • Attached File  22.jpg (78.54K)
    Number of downloads: 4



#2 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 11 August 2011 - 03:57 PM

Powershell to disable System Restore on C: drive.
disable-computerrestore "C:\"


#3 User is offline   illusions 

  • Junior
  • Pip
  • Group: Members
  • Posts: 61
  • Joined: 18-September 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 11 August 2011 - 06:28 PM

View PostYzöwl, on 11 August 2011 - 03:57 PM, said:

Powershell to disable System Restore on C: drive.
disable-computerrestore "C:\"




Hi owl,

Thank for the reply ...

I tried your suggestion and run the script but when i check system protection the
c drive is still "ON".

#4 User is offline   CoffeeFiend 

  • Coffee Aficionado
  • Group: Super Moderator
  • Posts: 5,260
  • Joined: 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 11 August 2011 - 08:17 PM

View Postillusions, on 11 August 2011 - 06:28 PM, said:

I tried your suggestion and run the script but when i check system protection the c drive is still "ON".

Did you run powershell elevated? You need to do that to change these kinds of settings on your computer. Otherwise, did you get an error message of any kind? Because that's a standard, built-in cmdlet to do it so I'd be surprised if it didn't work.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy