×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Performance

Script: Mass Windows system restore reducer by hgate73
Posted: 17 Apr 10

I noticed one day that Windows XP was set by default (out of the box) to use a whopping 12% (!) of the hard drive for system restore points. That's HUGE. We don't need all those on our systems, so this script crawls through the network (or, if you like, only your computer) and flips a registry entry to reduce the amount of space used by Sys Restore. In this script it lowers it to 2%, but you can change that to anything you want.

It reads names of computers to affect from names.txt, one per line.

CODE

:: Author:          hgate73 at gmail or yahoo
:: Purpose:         Reduces the amount of disk space allowed to be used by System Restore
:: Requirements:    1. Run this script with admin privileges
::                  2. reg.exe from Microsoft must be in any of these locations:
::                      a) the directory you run this script from
::                      b) c:\windows\system32\    (preferred)
::                      c) in the PATH variable
::                  3. Put the names of your computers, one per line, in a file called "names.txt" in the same directory as this script
:: Version:         1.0 Initial write

:: Prep
@echo off
title Mass SysRestore Reducer
set VERSION=1.0
set NAMES_FILE=names.txt
cls

:: Manual
:start
echo.
echo  Mass SysRestore Reducer
echo.
echo  Enter the IP or name of the remote computer, or "autoreduce" to
echo  auto-reduce the space used by SysRestore on ALL computers in %NAMES_FILE%
echo.
:loop
@set /P TARGET= Target Computer:
if %TARGET%==exit goto end
if %TARGET%==autoreduce goto auto
:: /v    value
:: /t    type (REG_DWORD in this case)
:: /d    data to assign to the value
:: /f    force overwriting the current value w/ no prompt
reg add "\\%TARGET%\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" /v DiskPercent /t REG_DWORD /d 00000002 /f
reg add "\\%TARGET%\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore\Cfg" /v DiskPercent /t REG_DWORD /d 00000002 /f
echo.
goto loop



:: HIROSHIMA!
:auto
title Mass SysRestore Reducing...
cls
echo.
echo Performing mass System Restore usage reduction.
echo Please wait...
echo.
:: We use a FOR loop to iterate through the list of system names.
:: %%i      is the current computer name read from the file
FOR /F %%i in (%NAMES_FILE%) do echo %%i && reg add "\\%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" /v DiskPercent /t REG_DWORD /d 00000002 /f
FOR /F %%i in (%NAMES_FILE%) do echo %%i && reg add "\\%%i\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore\Cfg" /v DiskPercent /t REG_DWORD /d 00000002 /f

title Mass SysRestore Reduce --  Complete
echo.
echo Mass SysRestore Reduce -- Complete
echo.
title %USERNAME%

Back to Microsoft: Windows FAQ Index
Back to Microsoft: Windows Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close