Windows XP Howto: Cleaning Up After Updates
This is probably the first in a series of Windows tweaks that I intend to make on my current installation of Windows XP Professional. As mentioned previously, the original installation was with Service Pack 1a. I have since updated it to Service Pack 2 (SP2). The first thing I noticed was that my harddisk was near its full capacity.
- Windows Cleanup: Resource Hog -
According to the official Windows XP Professional system requirements listed on Microsoft’s homepage, the OS needs at least 1.5GB of free space for a minimal installation. Prior to the updates, the operating system files occupied slightly under 2GB of space. This is about right considering the extra features that went in with the default install as well as the necessary space for the OS page files. After the upgrades, Windows had a footprint of 4.0GB! To say that the OS was bloated and was hogging real estate is an understatement. While 2GB of disk space is not noticeable on newer harddrives that have upwards of 80GB of storage, it is still occupying a significant amount of space that can be better put to use. The fact that I am using an old 10GB harddisk didn’t help matters any.
- Windows Cleanup: Disk Cleanup Utility -
The first thing that came to mind was the checkpoint and backup that SP2 made prior to its installation as well as the temporary folders that are usually created to accomodate installation files. Thinking to save some space, I ran the system tools Disk Cleanup utility to see what I could throw out. I was quite surprise that there was nothing in the temporary folders. Dropping the System Restore files under the “More Options” tab yielded roughly 200MB of space. Only 10% of the lost capacity. So what was renting the additional 1.8GB of disk space?
As it turns out, I should have read the Service Pack 2 System Requirements first, before going ahead with the install. According to the document, SP2 required 1.8GB of free space during the upgrade. I also found a better breakdown of disk space utilisation for SP2 at Microsoft’s Help and Support knowledge base resource pages. Armed with that knowledge, it was time to get down and dirty and shed some weight off the disk heavy OS.
Howto: Cleaning Up After Service Pack Update
Two permanent folders are created inside your %SystemRoot% directory (usually C:\Windows) whenever you perform an Express Installation of a Service Pack from the web:
| Folder | Description | Size |
|---|---|---|
| ServicePackFiles | Contains files used when you add or remove optional Windows components. It is also used by Windows File Protection (WFP) to replace corrupted protected system files. | 501MB |
| $NtServicePackUninstall$ | Contains backup files in case you need to remove the Service Pack and revert to the previous instance of the OS | Varies |
Relocating ServicePackFiles
The ServicePackFiles folder should not be deleted under any circumstance. It is necessary for when you need to update optional components of the Operating System. However, it is safe to relocate this directory if it is necessary to free up some disk space. Steps to do so as follows:
- Decide on a location where you want to move the folder.
- Relocate the file to the new location.
- Run regedit.
- Expand the navigation tree and locate the ServicePackSourcePath entry
under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ - Double click the entry and change the string value to reflect the new location of the ServicePackFiles folder
- Windows Cleanup: regedit Changes (Enlarge) -
Warning:
Before editing the registry, it is always advisable to make a backup first.
The place where you relocated the file is entirely up to you. You can burn it onto a CD, back it up onto removable storage media, or even store it on a shared network drive. In my case, I temporarily moved it to a portable harddisk, since my CD-Burner was still not functioning properly.
To test that you have correctly relocated the folder and edited the registry entry, run the Add or Remove Windows Component utility. Attempt to install a new component. If you stored the ServicePackFiles on removable media which is not connected, it will prompt you for the location of the directory. If the media is already loaded, it will not prompt you for the location but instead copy the necessary files from the location.
- Windows Cleanup: Test Install (Enlarge) -
If the test succeeds, congratulations, you’ve just saved yourself 500MB of local storage space.
Removing $NtServicePackUninstall$
If you’re certain that you are happy with the current Service Pack and will never uninstall it from the system, you can safely remove this directory. This is a hidden directory. That means that unless you’ve changed the view profile, you’ll be unable to see the directory. To locate and cleanly remove it as well as all references to it (particularly in the Windows Add/Remove Program listing), you’ll need to perform the following:
- Open your %Systemroot% directory (Usually C:\Windows).
- From the menu, select Tools » Folder Options.
- Select the View tab and select the Show hidden files and folders option.
- Locate the Service Pack Uninstall folder %Systemroot%\$NtServicePackUninstall$ and delete it.
- To remove the Service Pack uninstall option from the Add/Remove Programs menu, run regedit and delete the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Windows XP Service Pack entry from the registry.
- Windows Cleanup: More regedit Changes (Enlarge) -
If you did the registry edit correctly, the option for removing the Service Pack will no longer appear in the Add/Remove Program utility.
- Windows Cleanup: Option Removed -
Warning:
Before editing the registry, it is always advisable to make a backup first.
Once again, congratulations. You’ve just saved yourself some more disk space. It may varies depending on your install of Windows XP. In my case, it was 198MB.
That’s it for now. Hopefully this quick Howto was useful for you. If you have any questions, feel free to leave a comment.
Disclaimer:
Editing the registry via regedit is always risky business. If you don’t know what you’re doing or you’re uncomfortable with it, please refrain from modifying the registry. Following these instructions are at your own risk. The author does not bear any responsibility or liability over any loss that may result.
Related posts:
Windows XP Howto: Popping The Notification Balloon
A Waste Basket And A Box
PC Reformat: Windows XP Professional
Blue Screen Of Death
Random tech rant