Recipe 18.6. Cleaning Up Your Hard Disk


Problem

You want to clean up your hard disk by getting rid of useless and unnecessary files.

Solution

Using a graphical user interface

XP's Disk Cleanup tools provide a simple way to clean your hard disk of unnecessary files. To use it, choose Control Panel Performance and Maintenance "Free up space on your hard disk" and you'll see the screen shown in Figure 18-6. Check the boxes next to the files you want Disk Cleanup to delete, and click OK. If you want to view the files before deleting them, highlight the kind of files you want to view (such as Temporary Internet Files), and Windows Explorer will open to the folder containing the files. You can now view them before deciding whether you want to delete them. Once you're in the folder with Windows Explorer, you can delete files manually. That way, you can delete some, but leave others intact after you've deleted some files, don't tell Disk Cleanup to delete the remaining files.

Using the command-line interface

Disk cleanup does a good basic job of cleaning your hard disk. But using it can be time consuming, because you have to check and uncheck so many options. Also, there may be times when you want only certain files deleted and you want to keep others. For example, your temporary Internet files speed up web browsing by keeping on hand the graphics files associated with sites you frequently or have recently visited. So there may be times when you want those files kept, but you want other files deleted.

You can solve the problem by creating separate disk-cleanup profiles. That way, whenever you want your hard disk cleaned in a certain way, you can run just that one profile. For another set of cleanup options, you can choose a different cleanup profile.

To create separate profiles, you use the command line version of the Disk Cleanup tool: cleanmgr.exe. To do it:

  1. First, you need to create a new disk-cleanup profile. At the command line, type cleanmgr /Saveset:n where n is any number between 1 and 65535.

  2. The Disk Cleanup Settings dialog will appear, as shown in Figure 18-6, allowing you to select which items you would like to be deleted using this profile.

    Figure 18-6. Disk Cleanup Settings screen


  3. Note that this dialog box is similar but not identical to the GUI version of Disk Cleanup. You're offered several more cleanup options. Depending on what files are on your hard disk, you're able to automatically remove debug dump files, setup log files, catalog files for the Content Indexer, temporary setup files, old Chkdsk files, and various other items that the GUI version doesn't offer.

    If you're creating a profile to clean a drive other than the one that contains Windows, most of these options won't be enabled. You'll be able to automatically clean only the Recycle Bin and catalog files for the Content Indexer.


  4. Make your selections and click OK to create your cleanup profile. To run this profile at any time, type cleanmgr /Saverun:n where n is the number of the profile you've just created.

When using Disk Cleanup, from either the command line or the Windows GUI, be careful about letting it delete downloaded program files. These are often ActiveX programs and Java add-ins that are frequently useful, so delete them only if you know there are none that you use.


Manually clean your hard disk

Neither the graphical or command-line version of Disk Cleanup are necessarily the most effective way to clean your hard disk, even though they are the easiest. The tool won't find all the files you want to delete, and it might also delete files that you'd prefer to keep. For example, Disk Cleanup won't delete all the files in your \TEMP directory, even though it says that it will. Also, it doesn't touch files that are less than one week old.

Often, cleaning your disk manually is more effective than using Disk Cleanup. Here are the steps for doing a more complete hard disk cleaning:

  1. Empty the Recycle Bin.

  2. Search for all files that end in .bak and .tmp and that start with ~ (use the wildcard * when you search for example, *.tmp, *.bak, and ~*.*). Delete them all, except for any files that are dated the current or previous day. You might find that some files can't be deleted because they are in use. Don't worry about it; just leave them.

  3. Delete your temporary Internet files by running Internet Explorer and choosing Tools Internet Options General Delete Files.

  4. Delete old System Restore Points, which can take up a substantial amount of space. You can delete all your old System Restore Points except the most current one, but before doing this, make sure you don't need any old points. Run Disk Cleanup by clicking on "Free up space on your hard disk" from the Performance and Maintenance section of the Control Panel. Then, choose the More Options tab and click the Clean Up button.

Discussion

Hard disks are large enough so that you might think that there's no need to ever clean them. After all, with dozens or hundreds of gigabytes of free hard disk space, why bother?

But many unnecessary files can cause system problems, so cleaning them out regularly is a good idea. For example, some people have reported that when directories contain too many temporary files, their system behaves oddly for example, causing problems with applications like Word.

See Also

There are a number of pieces of software you can download that do a better job than Disk Cleanup or manual cleanups. CleanUp! (http://www.emesoft.se, $18.00, trial version available) expands on XP's Disk Cleanup tool by finding and deleting shortcuts and favorites that are no longer valid, giving you a list of Registry entries that point to files no longer on your hard disk, and letting you examine and delete Internet Explorer AutoComplete entries. System Mechanic (http:/www.iolo.com, $59.95, trial version available) is far more than a disk-cleanup tool. In addition to normal cleanup tasks, it finds and deletes obsolete and junk files that are left behind by uninstalled programs, finds and deletes duplicate files, finds and fixes broken shortcuts, cleans out the Registry, lets you fine-tune Windows settings, has privacy protection, and more. In all, it has a suite of 15 utilities.



Windows XP Cookbook
Windows XP Cookbook (Cookbooks)
ISBN: 0596007256
EAN: 2147483647
Year: 2006
Pages: 408

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net