I got a funny little task the other day where a I had to reduce the disk space that some Windows XP clients were using for System Restore Points. This was due to a very old application that couldn’t see above a 8 GB limit and hence thought that the machine was out of disk space while it actually had plenty of free space left.
Newer versions of Windows have a nice commandline utility (vssadmin) that quite easily can handle this issue when you’re an administrator managing a hole bunch of machines and don’t want to run around to each of them and click in a GUI. To my big surprise it was not that easy with Windows XP because while you can completely disable System Restore Points by group policy or registry tweak it’s not that easy to just reduce it’s space usage. We didn’t want to completely disable System Restore Points as they can actually be very useful in some situations (saved one of my clients at least once) so we found these handy registry keys that you can set to reduce the size:
reg add “\\%1\HKLM\Software\Microsoft\Windows NT\Currentversion\SystemRestore” /v DiskPercent /t REG_DWORD /d 1 /f
reg add “\\%1\HKLM\Software\Microsoft\Windows NT\Currentversion\SystemRestore\Cfg” /v DiskPercent /t REG_DWORD /d 1 /f
%1 = computername
This should reduce the size to a maximum of 1% total disk space. But guess what – after some days, several reboots and automated “disk cleanup” that runs every day (although excluding System Restore Point deletions) nothing happened and disk space usage remained unchanged. It turns out that the registry keys are ignored unless you go through the GUI manually and apply a change. After several hours of Goggleing I found a solution that disables and the reenables System Restore Points. After which it will apply the new registry key settings. You can run these commands remote from a batch file using Sysinternals PsExec utility:
%1 = computername