Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system restore w/Disk Percent specified

Status
Not open for further replies.

Briandr

MIS
Jul 11, 2003
177
US
Hi,

I found this script online for enabling windows system restore. I tried adding in some code that would set the disk percent, but it does not set correctly. I can through this script enable system restore.

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("SystemRestore")
errResults = objItem.Enable("")

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_

Thanks.
 
quick fix just use the dos command


Code:
vsscmd="vssadmin Resize ShadowStorage /For=C: /On=C: /Maxsize=10GB"
return = wshshell.run(vsscmd , 0 , true)

Code:
vsscmd="vssadmin Resize ShadowStorage /For=C: /On=C: /Maxsize=5%"
return = wshshell.run(vsscmd , 0 , true)

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top