The Explorer:Scrub Your Hard Disk Clean: Part 2 - InformationWeek
Software // Enterprise Applications
11:40 AM
Fred Langa
Fred Langa

The Explorer:Scrub Your Hard Disk Clean: Part 2

More ways to clean up -- including Cookie sweeping and Registry compacting!

This two-part series on disk cleanup began as an offshoot of our "Save Your Butt With DOS" series, which was itself occasioned by the imminent release of Windows Millennium Edition. You see, in WinME, Microsoft has hidden access to DOS and made it difficult even to create a bootable floppy disk. Alas, while Microsoft is doing its best to shield utter newbies from DOS, it's making life harder for the rest of us. Without easy access to DOS, some types of low-level, powerful disk diagnostic and repair operations become much more difficult.

Of course, Windows 2000 goes even further, by design; it has no component that we would normally refer to as standalone DOS.

The "Save Your Butt With DOS" series was and is designed to help you create a DOS-based toolkit you could stick on a shelf against future need; a toolkit that can help you get yourself out of system trouble even if you can't run Windows itself, or if you end up in a DOS-free version of Windows.

Part of a good DOS toolkit includes utilities in the form of "batch files," which are simple text files that contain a series, or "batch," of DOS commands. You can think of batch files as a form of scripting that can greatly simplify low-level system maintenance tasks. Knowing how to cobble together a simple batch file is a very handy skill, and so, as a starting point for our discussion of batch files, I offered a simple batch file called Cleanup.Bat.

Cleanup.Bat was just intended to show how an extremely simple text file could perform a very useful task -- in this case, cleaning up anywhere from (typically) tens to thousands of megabytes of junk files that can accumulate on your system, beyond the reach of Windows' own cleanup tools. Cleanup.Bat was also a teaching tool: By the end of the planned article, I was going to show you how to tweak, optimize, and streamline the basic batch file to do whatever you wanted it to.

But even in its basic form, Cleanup.bat was a huge hit. So big, in fact, it demanded a detour in our planned coverage of batch files, temporarily shifting to focus on disk cleanup techniques. "Scrub Your Hard Disk Clean, Part I" was the first such column. This column -- Part Two -- extends and expands on the concepts in that first column, so if you haven't checked out Part One, please do so now. (And as before, this column is specific to Win98, but can be generalized to other versions.)

Cleanup.Bat and the TIF
Cleanup.Bat has worked successfully on tens of thousands of readers' systems, cleaning up vast amounts of otherwise-wasted disk space. But one thing the original versions of Cleanup.Bat didn't do was clean up Cookies; and it also didn't erase many files in the TIF (Temporary Internet Files) area. That was by design:

Cleanup.Bat didn't touch Cookies because Cookies may contain site logon information, including passwords and other account information. Deleting the wrong Cookies may leave you unable to connect to your favorite sites. Worse, improperly deleting Cookies may leave a file called Index.Dat bloated with (literally) megabytes of bogus Cookie pointers; and improperly deleting the pointers may leave you unable to access the Cookies you do have.

Cleanup.Bat was selective in what it cleaned out of the TIF because handling the TIF is tricky: Portions of the TIF are created on the fly by Windows. You can see this for yourself:

In Windows Explorer, navigate to \WINDOWS\TEMPORARY INTERNET FILES (or wherever your TIF is located). Right click on the folder, and select properties: You'll see how many files are in the TIF, and how much space they occupy. Click Cancel, and then open the \WINDOWS\TEMPORARY INTERNET FILES folder in the normal way and take a look inside: You'll typically see a pile of files and some subdirectories.

Now drop to DOS (that is, exit Windows) and navigate to the same folder, such as by typing

Type DIR to see what in the folder. Surprise! Even though this is exactly the same folder you were looking at a moment ago inside Windows, its contents are radically different. In fact, the directory may appear empty.

Restart Windows, navigate back to your TIF, and presto! The files are back.

Except they're not really back: Many of the files in the TIF are actually ghosts: pointers to, or copies of, the real files which exist someplace else. Cookies, for example, may appear in the TIF, but they're really stored in the WINDOWS\COOKIES directory. Other content files may actually be stored lower in the TIF directory tree, such as those in a hidden directory called CONTENT.IE5.

1 of 4
Comment  | 
Print  | 
More Insights
Oldest First  |  Newest First  |  Threaded View
How Enterprises Are Attacking the IT Security Enterprise
How Enterprises Are Attacking the IT Security Enterprise
To learn more about what organizations are doing to tackle attacks and threats we surveyed a group of 300 IT and infosec professionals to find out what their biggest IT security challenges are and what they're doing to defend against today's threats. Download the report to see what they're saying.
Register for InformationWeek Newsletters
White Papers
Current Issue
2017 State of the Cloud Report
As the use of public cloud becomes a given, IT leaders must navigate the transition and advocate for management tools or architectures that allow them to realize the benefits they seek. Download this report to explore the issues and how to best leverage the cloud moving forward.
Twitter Feed
InformationWeek Radio
Archived InformationWeek Radio
Join us for a roundup of the top stories on for the week of November 6, 2016. We'll be talking with the editors and correspondents who brought you the top stories of the week to get the "story behind the story."
Sponsored Live Streaming Video
Everything You've Been Told About Mobility Is Wrong
Attend this video symposium with Sean Wisdom, Global Director of Mobility Solutions, and learn about how you can harness powerful new products to mobilize your business potential.
Flash Poll