Computer Education
Tips Blog WinXP Internet Computing Downloads Vista Home

Keeping Windows XP Systems Clean
Maintaining the Windows XP operating system to keep it free of accumulated junk is discussed.

Cleanliness has been preached as a virtue since ancient times and exhortations about that virtue extend to computer users. Methods of good PC housekeeping are an essential part of any user’s standard maintenance practices. Keeping things tidy will help to insure a faster, more stable system.

Cleaning up is a sufficiently important practice that many commercial software packages have been written to carry out various types of cleanup. While many PC users may prefer the option of using a commercial program, those who prefer to spend no money can do everything that needs doing with the already existing Windows accessories together with some readily available freeware. Even those who insist on the ultimate of a one-step multiple purpose cleanup application can achieve it with a simple script

Why is cleanup needed?

There are various ways that Windows systems accumulate unneeded files. The operating system and other software make use of a variety of temporary files that are created in several systems folders. These folders include several Temp folders. Normally, these folders are located in \Windows\Temp and \Documents and Settings\{User}\Local Settings\Temp. (This latter folder is more conveniently written as the environment variable %TEMP%.) Sometimes there may also be a Temp folder in the root (usually C:) directory or other locations as well. Some programs are better than others at cleaning up after themselves but many programs (including Microsoft Office) leave a lot of litter.

Another source of large numbers of temporary files is the Internet, Every time a page is downloaded from the Web, all the constituent files that go to make up that page are stored in a cache folder. For Internet Explorer the folder is called “Temporary Internet Files”.. (This applies to AOL users as well but other browsers such as Firefox have their own location.) A single Web page may have dozens of associated files. Every banner, button or other graphic requires a separate file. Thus it is very easy to accumulate many megabytes of files. At some point your Internet surfing will be slowed as the browser hunts through all the cached pages. Surfing the Internet also leads to the accumulation of “cookies”. This subject is covered in detail at a sister site.

The various kinds of temporary files can be created in very large numbers and require a substantial chunk of space. Before hard drive capacity grew to today's huge sizes, efficient use of limited space on the hard disk was a paramount concern. While that particular issue is much diminished today, cleaning up unnecessary files is still important for preventing slow-downs in operation. The more files that the system has to search through in carrying out a function, the slower it will be. For example, anti-virus scans, defragmenting, or backing up may take considerably longer. In extreme cases, too many temporary files can even cause system crashes.

Another area of the operating system that may need maintenance is the Registry. The Registry is constantly being accessed while your computer is in use. Practically every change that is made to the system affects the Registry. Over time the Registry acquires many useless entries and grows in size. Installing and then removing software almost invariably leaves junk behind in the Registry even when using the recommended uninstallation procedure. The more entries in the Registry, the longer it takes for the system to find things and over-all operation may be slowed. More recent Windows systems have a lessened tendency to problems in this area than Windows 98/Me had but proper Registry maintenance can still be useful for those who make many system changes and program installations.

Disk Cleanup tool

Windows comes with a system tool called Disk Cleanup that can help keep the system clean. The tool can be accessed in several ways. It is listed in the Start-All Programs- Accessories-System tools group. It can also be opened by right-clicking on a drive icon in My Computer, choosing "Properties" from the context menu, and clicking the button "Disk cleanup" on the properties sheet. Another and perhaps quicker way to open the accessory is to enter "cleanmgr" into the Start-Run line. This accessory provides a unified interface for managing various temporary files and the Recycle Bin. Using it is discussed in more detail on another page. As discussed in that reference, the Disk Cleanup utility has some limitations. However, it may provide an adequate method for managing temporary files for those who do not run many programs. More active PC users may prefer more thorough methods as discussed in sections below.

Clean the Temp Files

Each user account has a folder where programs put temporary files. The easiest way to reach the folder is to use the environment variable %TEMP%. Some programs also use a folder \Windows\Temp. Although these temporary files can be deleted by going directly to the folders in Windows Explorer, selecting all the files, and doing a delete, the process is often interrupted because some file is in use and is locked. A better method is to use the command line. Entering the command del /f /q /s %TEMP%\* %windir%\temp\* will clean up all unlocked files in the two temp folders. If you prefer, I have written a script for this chore. The script also removes empty subfolders. Files that are in use or locked will not be removed.

Clean Internet Explorer 7 Cache (Temporary Internet Files)

Internet Explorer (IE) stores Web pages that you view in a folder named "Temporary Internet Files" that is normally kept in the location \Documents and Settings\{User}\Local Settings\. Delete Browsing HistoryThe purpose is to help speed up browsing if you return to a page.As mentioned above, these files can accumulate and periodically deleting them can sometimes actually speed browsing. Deletion can be done in Disk Cleanup or in the settings for Internet Explorer. Various other kinds of data are also kept. These records can be deleted as indicated in the figure on the left. This dialog box is reached through "Internet Options" by clicking the "Delete" button in the "Browsing History" section. Deleting Temporary Internet Files by this method does not completely clean the folder with that name. In addition to material from pages downloaded from the Web, the folder also contains Internet cookie pointer files involved in the rather convoluted system used by Microsoft.

Also left alone is the hidden system file "index.dat ". This type of system index file is also in the "Cookies: and "History" folders. They cannot be deleted in the usual ways but It sometimes happens that one of them becomes corrupted and causes IE to crash. To deal with this problem, Microsoft has a special tool for removing everything called the Clear Cache Feature for Internet Explorer. Note that it removes all cookies so that logins and other information stored in cookies will have to be re-entered.

My personal choice for keeping the Internet cache from growing too big is to use the setting that clears the cache whenever IE is closed. Open the Internet Options dialog box and click the tab "Advanced". Scroll to the section "Security" and check "Empty Temporary Internet Files folder when browser is closed". Note that not all files are deleted by this method. Cookie pointers and certain other files are retained. The figure below illustrates the setting. Empty Temporary Internet Files folder when browser is closed

Clean the "My Recent Documents" folder

The Start menu in Windows XP contains an entry, My Recent Documents, where a list of all the recent documents that you have opened or used is kept. This provides a quick way to reopen any document. After a while the list can get quite long and it has the effect of slowing the bootup process. I don’t think that it is generally recognized how many shortcut files this folder can accumulate over time. It can actually affect the performance of your machine, especially at logon. The ones that are visible on the Start menu are only the latest 15 entries. The actual folder %USERPROFILE%\Recent may have many more than that. Also not always understood is the fact that the this folder continues to collect entries even when “My Recent Documents” has been removed from the Start menu. You can prevent an ever-growing accumulation by periodically cleaning it out. I have discussed managing these files at this reference. You can also modify the Registry to clean up automatically and that is discussed here.

Empty the Recycle Bin

Configure Recycle BinThe Recycle Bin is easily emptied either directly or by using the Disk Cleanup utility. Even so, many PC users forget to periodically empty the deleted files and accumulate large numbers. If the Recycle Bin becomes too large, it can slow the system. One solution is to limit the size of the Recycle Bin. By default, the size is set at 10% of the hard drive, which is excessive on today's large drives. A more practical limit to the size is something like 1%. To change the amount of space that is set aside for the deleted files, right-click the Recycle Bin and open "Properties". The figure in the left illustrates. Move the slider shown on the properties sheet to decrease the amount of disk space that is reserved for storing deleted items.

Cleaning the Registry

The Windows Registry, the system database that seems so mysterious to many, is in unceasing use during a Windows session. It is constantly being accessed, added to, and subtracted from. Gradually. the Registry can accumulate erroneous or obsolete entries. In older versions of Windows, this process of building up Registry mistakes and unnecessary pieces was a definite problem and made it a very good idea to routinely use accessories that cleaned up the Registry. The Registry is considerably more robust in Windows XP but an occasional cleanup can still be useful. There are a number of programs that can be used for this type of maintenance but some are much better (and safer) than others. The best free program is probably EasyCleaner. Among all-purpose commercial suites, I prefer JV16 PowerTools Caution should be exercised when using even the best of the group since removing Registry entries can have unexpected results. Always back up first.

Go here for a good review of some of the available software.

Scripting cleanup

There are numerous ways to automate cleanup in order to make the chore less onerous. One way is to schedule the Disk Cleanup utility to run regularly as described here. There are also various scripts that can be found that don't have some of the limitations of Disk Cleanup. Fred Langa has written some all-purpose batch files and I have written a script specifically for Temp folders. Others can be found by an Internet search.

Software utilities

There are many commercial programs that claim to clean up Windows. Frankly, most would be a waste of money if you bought them. One commercial program that I can recommend is JV16 PowerTools. This suite of programs does more than carry out cleanup functions. It is a general purpose application with many useful features for computer and file management. A freeware cleanup program that is highly regarded is CCleaner. This latter program can be quite aggressive in its cleaning so be sure to check all the settings before you use it.

Use any cleanup program with care and back up your system first.


 << Home page ©2002-2008 Victor Laurie    Home page >>