My batch file for Windows computer system maintenance.

Instructions for using the batch file, and features.

By Andrew Westcott


I run several Windows 98 installations here, as I find this operating system does everything I need and doesn't come with all the bloat of later operating systems. This isn't some die-hard attitude - it's simply that I have never seen any point in paying for a newer operating system which does exactly the same as the old, only slower....

OK, moving on.

Over a period of time I felt the need to develop an automated method of removing many of the junk files which accumulate over time on a well-used computer, as removing them manually was becoming tedious especially as many of them could only be removed from true MS-DOS mode and were undeletable from within Windows. If these unneeded files are allowed to accumulate it is possible that the computer can become less responsive especially with the slower processors, and a lot of disk space can be going to waste. The obvious answer was to write a DOS batch file to do the job, which I did, and subsequently installed it on each of the computers here. Now it's just a case of restarting in MS-DOS once in a while, executing the batch file and running whichever option I choose. To aid my memory, it also creates a log file on the root of the C drive of the jobs completed and the date. I realise that there are other batch files for doing this kind of system cleaning available on the internet, some of which are worse than others, but this one gives me all the flexibility and options I require, and is easy to use.

I know of a fair number of people who are also still using Windows 98, and I have offered the batch file to many of these who are now running it with great success, so I have now decided to offer it for the wider community as freeware. I occasionally look over the code and make adjustments, maybe to correct an error, add a feature or make the batch file more efficient, so each version has a version number based on the date it was updated, so if you are currently using this file you can now check you have the latest version.

I would be very interested to hear from anyone who has made use of this batch file, so that I can get some kind of idea of how many people are using it - please feel free to contact me at the e-mail address at the bottom of the page if you have found the file to be of any use.


If you wish to link to this batch file, please link only to this page, not the file itself as the location may well change leaving you with a dead link. Copying this file for placement on another website is forbidden - use a link to this page only.


This batch file is offered 'as is', and with all faults; No guarantee is given or implied by the offering of this software that it will be safe to use on your particular installation and you use it entirely at your own risk. It is entirely your responsibility to ensure that you have adequate backups and I cannot be held liable for any problems which may arise either directly or indirectly from its use or abuse.

It is important that you only use this batch file on a Windows 98 system, and that you follow and understand any instructions given, either here or within the program. A moderate knowledge of computer systems is advisable to ensure you know what the program is doing.

Instructions For Use

This batch file is offered in both the bare bat and in zip format. The zip version must be downloaded and then unzipped into your Windows folder - it won't work if you place it anywhere else. If you don't have an unzipping utility, download Winzip or Winrar to do the job - both are available with a free trial period. The bat version may be dowloaded by right-clicking the link and choosing 'save target as' or 'save link as' depending on your browser.

Version 9.12.5 in .ZIP format

Version 9.12.5 in .BAT format

IMPORTANT! The file must be placed into your C:\WINDOWS folder to work.

Those of you already using my file, check your version number and if the one on offer here is more recent than the one you have, simply download it, allowing this new file to overwrite the old one. You can check your version by opening a DOS box from within Windows, accessible via the program menu as the 'MS-DOS Prompt', typing in 'clean' and pressing the return key. Do it right now if you like!

This batch file can only be run properly in true DOS mode, therefore if an attempt is made to launch the file from within Windows by either clicking on the file or launching it from a DOS box, I have designed it to refuse to run whilst displaying a message to this effect.

In order to run the batch file correctly, you must first shut the computer down to MS-DOS mode by selecting that option from the shutdown menu, as in the image below:

Image of the shutdown dialogue box

After a few seconds once the computer has shut down from Windows the DOS prompt will appear with a flashing cursor, as in the image below:

Image of a DOS prompt

Simply type in the name of the batch file, which is CLEAN, press the enter or return key and it will begin to run, and after a few seconds during which the file prepares and checks its environment, you will be offered a list of cleaning jobs available. Simply decide on the option you require and follow the instructions.

The options currently available are:

  1. Clean out temporary internet files and other junk
  2. Remove all internet history files
  3. Remove all cookies
  4. Delete all Windows TEMP files
  5. Renew your icon cache
  6. Repair and compact the registry
  7. Perform a scan of your hard drive
  8. Perform options 1, 2, 3, 4 and 5 in one go
  9. Close the program and return to MS DOS

The most useful and frequently used is option 1, the rest doing more specific cleaning which doesn't need to be performed on such a regular basis. Options 1, 2 and 3 clear out accumulated files which can also be removed within Internet Explorer, but in addition to these files, certain other normally hidden and undeletable files are also removed. It is in fact highy beneficial to delete your temporary internet files and cookies using the removal feature in Internet Explorer before running this program, as otherwise it could take a considerable amount of time to delete them from DOS. This option can be opened by right-clicking the blue 'e' on the desktop, whereupon you will see a box similar to the one below:

Image of a DOS prompt

The three buttons of interest are the 'Delete Cookies', which deletes your cookies, the 'Delete Files', which deletes your temporary internet files, and the 'Clear History', which clears out your history of visited web sites. Note that doing this does not clear out everything, which is when my program comes in with the ability to delete everything that is left over.

I can be e-mailed at this address:

© Andrew Westcott 2003 - 2010

Valid HTML 4.01!