Win2k3: What files can be deleted from the System drive, and what tool to delete them

disk-space-utilizationwindows-server-2003

The strategic question is "How do I maximize free space on the System drive," and includes such things as disk compression, changing the TEMP environment variable, removing the hibernation file, minimizing the swap file, buying a larger drive, etc. This is the tactical question about what files can be removed safely, and whether to remove them with a file system command or by changing a retention-setting somewhere.

For example, C:/WINDOWS/Installer on of my machines is 1.5G, and the newest files in there are fifty days old. Total free space on that C: drive is 3G. Is the proper approach to burn them to optical disk just-in-case, then delete them from the command line, or is there some Registry setting that will let Win2k3 do something more sophisticated? Or is that 1.5G of precious, precious treasure?

Edit: The issue is particularly acute for virtual machines, where there will be system snapshots in multiple configurations. An 8G disk is (initially) amply sufficient to run Win2K3, Visual Studio, SQL Server, and the application being developed, but over time cruft from old patches consumes enough resources to prevent new patches from being applied.

Best Answer

Please do not remove the contents of %SYSTEMROOT%\Installer. If you do that, then in the best case you'll be unable to uninstall and/or repair any program installed from a Windows Installer database, and in the worst case all Windows Installer-serviced programs that have advertised autorepair capability will stop working (or at least annoy you every other minute with "Windows Installer is configuring program blahblah" dialog boxes while suspending program execution.)

There is no safe automated way to clena up a drive. Once you delete the obvious (%TEMP%, %SYSTEMROOT%\Temp, %SYSTEMROOT%\SoftwareDistribution\Download) all that's left is uninstalling unused stuff and compressing rarely used stuff.

You might also want to delete the (hidden+system) folders under %SYSTEMROOT% that hold the hotfix / Windows Update patch uninstall backups, unless you plan to uninstall windows hotfixes.