Do you have a PC that’s had Windows on it for a long time? As you use the PC, it may seem like there’s gradually less and less free hard disk space, even though you routinely remove old programs. Windows is notorious for taking hard disk space and not giving it back. In this Daily Drill Down, I’ll examine ways to get back some of that lost hard disk space.
.chk and .dir files
The first place to look when you need to clean up Windows is the root directory. As you may know, Windows automatically runs ScanDisk any time that the system is shut down incorrectly. If ScanDisk encounters fragments of data that it doesn’t know how to handle, it sometimes converts those fragments into files and places these files in the root directory.
When ScanDisk encounters file fragments, it will create a .chk file. A .chk file’s full name will be something like File0001.chk. Windows increments this number for every additional fragment that ScanDisk encounters. Therefore, the next file would be File0002.chk. You can safely delete any file with the .chk extension from your root directory. I’ve found that the easiest way of doing this is to go to an MS-DOS Prompt window and execute the following commands:
C:
CD\
ERASE *.CHK
Occasionally, ScanDisk will encounter a damaged directory. If the directory name is unreadable, ScanDisk will assign it a name like Dir00001. ScanDisk will place any recovered files into this directory. If you have directories with names like these on your PC, simply check the contents of the directories to make sure there’s nothing you need inside them. If you do find files you need, move the files back to their original location. If not, or after you’ve moved the needed files, simply use Windows Explorer to delete the directories.
Old profiles and .pwl files
If you work in an office environment, one way to clean up Windows is to delete profiles and .pwl files that are no longer needed. Every time that someone new logs onto the computer, Windows will create a .pwl file for them. This .pwl file contains the user’s passwords. The .pwl files aren’t very big, but if a lot of people have used your PC in the past, it’s not a bad idea to clean up the unneeded ones. Windows creates .pwl files based on login name. Therefore, if someone were to log onto a PC as Brien_Posey, you might look for a file with a name like Brien_~1.pwl. The .pwl files are located in your Windows directory. If you have a hard time locating all the .pwl files, you can open an MS-DOS Prompt window and type the following commands to list all the .pwl files that exist on your system:
C:
CD\WINDOWS
DIR *.PWL
In some environments, each time a new person logs on to the computer, Windows also creates a profile for that person. The profile stores information like custom desktop settings. Profiles can consume a lot of space. Profiles are stored in the hidden directory \Windows\Profiles. Each user has his or her own directory beneath the Profiles directory. Keep in mind that this doesn’t exist on all systems.
If you’re using Windows 95, there isn’t a graceful way to clean up the old profiles. You can delete the Profiles directory for users who no longer use the system. There are also Registry settings referencing those profiles that can be optionally removed. Keep in mind, though, that editing the Registry can be dangerous if you don’t know exactly what you’re doing. Making incorrect changes in the Registry can destroy Windows and/or your programs. Always back up your computer before making any changes to the Registry. With that said, if you want to remove unneeded profile references from the Registry, open the Registry and navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProfileList
An entry for each user on the computer may be found beneath this point.
Windows 98 makes it much easier to clean up old profiles. First, open Control Panel, then double-click the Users icon to display all the profiles loaded on your system. You can delete unneeded profiles via a simple graphical interface.
Temp files
Temporary files can consume an astronomical amount of space. These are files that a program needs to refer to on a temporary basis but often neglects to remove when it’s done. Therefore, the temporary files often accumulate on top of each other, thus wasting more and more hard disk space. If your system has a bunch of old temporary files, they’re probably located in one of these directories: Temp, Tmp, or DOS. If you’ve checked these locations and didn’t find any temporary files, then open your Autoexec.bat file and search for a line that starts with TEMP = or SET TEMP =. Such lines often reveal the location of temporary files.
Internet cache
Your Web browser can also waste a lot of space. As you may know, any time you visit a Web page, the entire contents of the page are downloaded to your computer. This includes not only the HTML code, but also sounds, pictures, videos, and so forth. As you visit more and more pages, the contents of those pages can begin to accumulate in the cache directories on your hard disk. You can initially clear the cache files and free up some hard disk space by opening Internet Explorer and selecting the Internet Options command from the Tools menu. When you see the Internet Options Properties sheet, select the General tab. Next, find the Temporary Internet Files section on the General tab. Use the Delete Files button to flush the Internet cache.
Once you’ve emptied your Internet cache file, you can control the size the cache directories will grow to in the future. To do so, click the Settings button next to the Delete Files button. When you do, you’ll see the Settings dialog box. In older versions of Internet Explorer, you can set the amount of space to use in terms of a percentage of your total hard disk space. For example, ten percent of a 10 GB hard disk is 1 GB. However, in newer versions of Internet Explorer, you can simply set the number of MB that you want to limit the cache size to.
Old DOS
If you upgraded to Windows 95 or Windows 98 from another operating system, you were asked during the installation procedure whether you wanted to back up your old operating system. If you chose to do this, Windows compressed the operating system and placed it into one very large file on your hard disk. Windows then created a second file that contained instructions to Windows for decompressing the original file.
Normally, if you decide that you no longer need the ability to uninstall Windows, you should get rid of these files by opening Control Panel and using the Add/Remove Programs utility to remove your previous operating system. However, this doesn’t always work. Sometimes, you have to do it the old-fashioned way. To do so, open an MS-DOS Prompt window and type the following commands:
C:
CD\
ATTRIB WIN98UNDO.* -S –H –R
ERASE WIN98UNDO.*
Obviously, these commands will work only if the files Win98undo.dat and Win98undo.ini exist. If these files don’t exist, the commands that we’ve listed above will produce errors.
The Registry and .dll files
Perhaps the biggest waste of space is the way that Windows handles application programs. Typically, when you install an application, it creates a program directory that it installs itself to. However, it usually also places .dll files in the \Windows\System directory and adds settings to the Registry.
When you decide to uninstall most programs, you probably use the Add/Remove Programs utility. However, doing so rarely removes the .dll files or the Registry settings. Most of the time, it only deletes the program files.
You can clean up the .dll files and Registry settings manually, but you must be careful. Remember my earlier warning about the Registry and be sure to back up your computer before you try this.
Begin by opening the Registry Editor and searching for references to the program. Any time that you find a reference to the program, check and see whether any of the values under the key refer to .dll files. If they do, write down the name and location of those files. If the entire key is related to the program, feel free to delete it. However, if only certain values under the key relate to the program, delete only those values.
Once you finish going through the Registry, close the Registry Editor and rename all the .dll files on your list to use a unique extension. For example, you might rename a file such as Brien.dll to Brien.lld. Doing so will keep Windows from recognizing the file. Now, reboot Windows and make sure that all your programs still work. This is necessary because some programs share commonly named .dll files. If you receive an error message, rename the .dll file in the message to its original name. Once all your programs are working, erase any files from your hard disk with the .lld extension (or whatever unique extension you used to designate your old .dll files).
Other space consumers
If you’re really desperate to free up space within Windows, there are some other things to look for. Add-on components such as fonts, wallpapers, sounds, and icons can eat up space fast. If you’ve added any of these items to your system, check to see how much space they are taking up. You might be surprised.
FAT 32
One last way to get some space back is to convert your hard disk to FAT 32. FAT 32 reduces the size of the clusters used. When a file is written to a hard disk, it always consumes whole clusters, even if part of the cluster is wasted. For example, a 2-GB hard disk on a FAT 16 partition uses 32-KB clusters. This means that if you were to save a 33-KB file to the hard disk, Windows would have to use two clusters to accommodate it. This means that your 33-KB file is actually consuming 64 KB of hard disk space. 1 KB of the second cluster is used while the other 31 KB is wasted.
Converting that same 2-GB partition to FAT 32, though, would reduce the cluster size to 4 KB. This means that the 33-KB file that I just discussed would consume nine clusters, which equals 36 KB. Therefore, only 3 KB is wasted instead of 31 KB. While this may not sound like much of a savings, imagine the difference that it can make to get a few KB back on every file on your entire hard disk.
You can convert your hard disk to FAT 32 by using the Drive Converter tool found on the Start | Programs | Accessories | System Tools menu. However, before you convert your hard disk, be aware that only Windows 98 and the OSR2 version of Windows 95 can read a FAT 32 partition. If you ever use an operating system such as DOS, Windows NT, or Linux on your computer, those operating systems won’t be able to use the FAT 32 partition. Therefore, FAT 32 is only an option if Windows 98 is the only operating system that you use.
Reformat
There’s always the chance that you could work through all of the techniques that I’ve described so far but still not have enough free hard disk space. In such instances, it can be helpful to back up your data and reformat your hard disk. After doing so, reload Windows from scratch. This method is absolutely guaranteed to give you a clean copy of Windows.
Conclusion
In this Daily Drill Down, I’ve discussed some ways that Windows 98 steals hard disk space. I also explained several methods of getting that space back. These methods involve removing temporary files, some types of archival files, and damaged files. In addition, I discussed ways of cleaning up the Registry and removing Windows components that are no longer needed. Finally, I discussed converting your hard disk to FAT 32.
Brien M. Posey is an MCSE and works as a freelance technical writer and as a network engineer for the Department of Defense. If you’d like to contact Brien, send him an e-mail. (Because of the large volume of e-mail he receives, it’s impossible for him to respond to every message. However, he does read them all.)
The authors and editors have taken care in preparation of the content contained herein, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.