Karbosguide.com. Software Tip 3a

About temporary files - get rid of them (I)

  • Next page
  • Previous page

  • Windows continuously creates temporary files. They are temporary files, which really need to be deleted. However, they are never deleted automatically - certainly not when Windows crashes, as it sometimes does. They are in the folder C:\Windows\Temp. You ought to check it routinely:

    It is to your advantage to delete these temporary files. They just take up space and there can be hundreds of them.

    However, the problem is that you may not be able to delete all temporary files while Windows is running - some of them may be active. Therefore I recommend this simple method: put a line in your Autoexec.bat! You can find the file Autoexec.Bat (Autoexec) through Start -> Find. Right click on it and choose edit. Then type the line shown below and save the file:

    echo Y | del c:\windows\temp\*.*

    This will cause all temporary files to be deleted at any start-up. The echo command adds a "Y" into the del command, so you do not need to confirm with a "Y" to execute the delete.

    You may also want to delete the subdirectories using this command:

    deltree /y c:\windows\temp\*.*

    Use the Autoexec.bat

    Windows also has tools for cleaning the harddisk. However I still recommend the following addition to the Autoexec.bat. This only works in Windows 98, since Windows Me has no Autoexec.bat.

    Autoexec.bat is a text file, and it has to be to be edited. If you worked with your PC ten years ago, you would not ask what Autoexec.bat is. We used it all the time to tweak more free memory out of the start-up.

    Autoexec.bat is the central start-up file in any DOS-based computer. It holds a number of "lines" (written in simple text).

    Each line in Autoexec.bat is to be executed during the start-up - one by one. Hence the file type is BAT, which stands for batch. A batch file holds one or several of lines of commands. And here we add three lines into the Autoexec.bat.

    To open Autoexec.bat, you find Windows Explorer and highlight C:\ (the root directory) in the left frame. In the right frame you find Autoexec.bat. Highlight it and make a rightclick on it. Then choose edit, and it is opened for you in Notepad.

    Make your changes and save the file, which then works after re-boot.

    Using Autoexec.bat is smart since it cleans up every time you boot the pc. The first line to add:

    deltree /y C:\Windows\temp\*.*

    This line deletes all the temporary Internet files including the subdirectories, which all the time is created in C:\WINDOWS\Temporary Internet Files:

    deltree /y C:\Windows\TEMPOR~1\*.*
    Finally add
    C:\WINDOWS\COMMAND\deltree /y C:\Windows\cookies\*.*
    This line clears out the cookies, which my browser collects all the time. The PC has to reboot for the Autoexec.bat to work. You can monitor the deletion on screen during the start up (hit [pause] key to freeze the screen).

    Three lines

    You may use these three lines in my Autoexec.bat:
    C:\WINDOWS\COMMAND\deltree /y C:\Windows\tempor~1\*.*
    C:\WINDOWS\COMMAND\deltree /y c:\windows\temp\*.*
    C:\WINDOWS\COMMAND\deltree /y C:\Windows\cookies\*.*

    The first line empties the browsers cache - a good thing. The second line cleans up after Windows in general. The third line clears out the cookies, which the browser collects all the time.

    All use is on your own responsability - you may experience some problems using this tip, so please test it.

    The next tip shows another option. Also read more about deleting these files in Tip 18.

  • Next page
  • Previous page

    Copyright (c) 1996-2001 by Michael B. Karbo.