Learning About Computers and the Internet
Tips Blog WinXP Internet Computing Downloads Vista/7 Home

Keeping Microsoft Windows PCs Clean
Maintaining the Microsoft Windows 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”.. (Other browsers such as Firefox and Chrome have their own location in database form.) 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”.

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 but proper Registry maintenance may still be useful in Windows XP for those who make many system changes and program installations. Windows Vista/7 systems are rarely likely to need this type of maintenance, however.

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. In Windows XP, 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 Run line or the Search box of the Start menu. 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. Files that are in use or locked will not be removed.

Clean Internet Browser Caches

Internet browsers store Web pages that you view in a folder on your local computer. The purpose is to help speed up browsing if you return to a page. These files can accumulate and periodically deleting them can sometimes actually speed browsing. The exact procedure depends on which browser you are using but there is a useful keyboard shortcut that works in all common browsers and will speed up the process. It will take you right away to the dialog for cleaning up the stuff your browser accumulates, It is Ctrl+Shift+Del (Hold down all three keys at the same time.) This shortcut works for Internet Explorer 8 and up, Google Chrome, and Firefox 3.6 and up. The graphics below show the dialog that opens in each of the three types of browser when the shortcut is used.

Internet Explorer

Internet Explorer dialog

Google Chrome

Chrome dialog

Firefox

Firefox dialog

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.

Configure the Recycle Bin

Windows XP

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 in Windows XP, right-click the Recycle Bin and open "Properties". The figure on 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.

Windows Vista/7

In Windows Vista and Windows 7, the configuration of the Recycle Bin is somewhat different. Right-click the Recycle Bin and choose "properties" from the context menu. The dialog box shown below will open. The size is set by entering a number in "Custom size".

Windows 7 recycle bin configuration

Cleaning the Registry

It is my personal opinion that the average PC user should forget about Registry cleaning. My reasoning is given in this article. Experienced PC users who are interested in Registry cleaning will find information about the programs that are available for this purpose at this link.

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. A freeware cleanup program that is highly regarded is CCleaner. This 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-2014 Victor Laurie    Home page >>