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.
Associating the files with patches.
The "WINDOWS\Installer\
" folder has several key
sub-folders.
You can search for the sub-folder name (without the braces {}
) in the registry.
The key can be searched within the "HKLM\SOFTWARE\
" tree
to get the Software association.
The key would be placed in the Installer
sub-tree on the name ENU_GUID
.
Similarly, in the registry path "HKEY_CLASSES_ROOT\Installer\Products\
",
The key will usually match in a subtree against the "ProductIcon
" name.
There will be a "ProductName
" field next to it that will give you an association.
This search should be script-able with a dir WINDOWS\Installer /d
output
stored to a text file that is processed with a registry search.
The .MSP
files have a level of indirection in the registry.
You should search for the MSP name first in,
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\
That will give you a Patch number (the sub-tree name string) which is to be then searched again in the same path as above. The associated registry sub-tree will give you details for the patch.
Meanwhile, the mouse-over context in my Windows XP explorer also gives basic information on the patch. Have you checked that already?
Older data:
Use msizap to remove orphaned cached Windows Installer Data Files to increase free disk space.
Msizap is a command-line tool that can delete the configuration data that Windows Installer maintains for products that it installs, including the directories, files, registry subkeys, and registry entries in which Windows Installer stores configuration data.
Running msizap.exe with the G
parameter removes orphaned cached Windows Installer data files for all users
The article discusses up to Windows Server 2003.
Update: This Microsoft KB description also limits at Server 2003.
It should work for Server 2008, or there would be another version for it.
The article describes existence of two versions.
There are two versions of MSIZAP.EXE:
MsiZapA.exe (for use in Windows 95, Windows 98 and Windows ME), and
MsiZapU.exe (for use in Windows NT, Windows 2000, Windows XP, and Windows Server 2003). The appropriate executable should be renamed MsiZap.exe.
Download references -- in case that link goes dead.
Msizap can be downloaded as a part of the Microsoft Windows Server 2003 Support Tools or the Windows Installer CleanUp Utility (EXE). I was unable to find the Windows Installer CleanUp Utility by searching Microsoft’s download site, so note that as of today the file’s name is msicuu2.exe if you the above link goes dead in the future.
If you don’t want to install the Windows Installer CleanUp Utility, use a program such as Universal Extractor (aka UniExtract) to extract the individual files. Once you extract the files, you’ll notice msizap.exe does not exist, but you will find MsiZapA.exe and MsiZapU.exe.
Best Answer
Old user accounts - use the user profiles from the system properties to delete them so you wipe any cruft from the registry as well.
Log files shouldn't be an issue to delete as long as they're not open.
Compression can help. Slows a little, especially if short on RAM, but can help.
Turn on "show hidden files" and in the Windows (or windows system) folder there should be a huge bunch of hidden compressed files used to roll back changes to updates. I usually don't have a problem "deleting" them as long as I have a backup in place and don't think I'll be rolling back any system updates in the future.
Suggestion - get your hands on an external hard disk and instead of deleting things, move them to the other storage. If there's an issue where the server goes kaplooey in the next day or two, you can restore it rather easily. Just don't use FAT on the external storage as large files can have issues with it.
I usually use 7zip to compress things I'm not sure that I'll need for awhile and archive it. Free, fast, can create self-extracting executables and tends to be better than ZIP.
Double check your windows components have just what you need installed. No need to have games if you don't use them (on a server??)
Double check that your program files subdir has just the programs you currently run in there. I have deleted old subdir cruft that was left behind from uninstalls.
Check that there aren't multiple versions of Java installed if you don't need them.
Check for caching of crud. Temp internet files, temp folders used for downloads, and cache directories in user subdirs are candidates for checking. I use "bytecount" (freeware) to get a good estimate on sizes of subdirectories because it's uber-tiny and simple to use.