Get rid of those pesky Windows XP temp files

I just recently stumbled upon a nifty way to make my windows xp machine run a little bit faster. Check it out.

If you search your entire computer for temp files, you may be surprised to find hundreds of megabytes worth of data that has been sitting around since God knows when. Windows is supposed to automatically delete these, but sometimes it just doesn’t happen. Now… supposedly when you boot up your computer or internet explorer, Windows will scan through your temp files (looking for recently viewed web pages, etc). So if everything is cluttered up, things might run a little bit slow.

So the goal here is to delete all temp files before we shut down the system at the end of the day. This way, everything is fresh and clean, come next morning!

  1. Open up a copy of notepad and paste in the following chunk of text:

    @echo off
    taskkill /F /FI “USERNAME ne SYSTEM” /FI “USERNAME ne LOCAL SERVICE” /FI “USERNAME ne NETWORK SERVICE” /FI “IMAGENAME ne explorer.exe” /FI “IMAGENAME ne cmd.exe” /FI “IMAGENAME ne taskkill.exe”
    RD /S /q “%HOMEPATH%Local SettingsHistory”
    RD /S /q “%HOMEPATH%Local SettingsTemp”
    RD /S /q “C:temp”
    RD /S /q “C:WindowsTemp”
    SHUTDOWN -s -t 01

  2. Save the file off as “C:shutdown.bat” (make sure you set the file type as “All Files”, *not* “Text Documents”)
  3. Browse to your C: drive using windows explorer and right-click on the shutdown.bat file. Select the “Create Shortcut” option in the context menu.
  4. Rename the shortcut file to “Clear Temp Files & Shut Down”.
  5. Right-click on the shortcut and select “Properties” from the context menu.
  6. When the properties window pops up, make sure you are on the “Shortcut” tab and click on the “Change Icon” button. If it gives you some kind of error about the file not containing any icons, ignore it and just click OK.
  7. Where it says “Look for icons in this file:”, make sure that it says, “%SystemRoot%system32SHELL32.dll”.
  8. Select the red, square icon with the circle and a vertical line in the middle. This is the shutdown icon that you see when you click on your start button and select “Turn off your computer”.
  9. Ok your way out of there back to your explorer window.
  10. Drag the shortcut to your desktop.

Now, whenever you want to shut down your computer, just double-click the icon on your desktop!
Windows will clear your temp files after killing all your programs (it can’t clear temp files if programs are currently using them), and then it will proceed to shut down.

IMPORTANT NOTE: If you are using Windows XP Home, you may not have the taskkill.exe file, as it only comes with Windows XP Pro by default. Click here to download it and extract it to your C:WindowsSystem32 folder.

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you a real person? *