Windows Guides Feed

9-1-2009 22-02-11If you want to give Windows Enterprise 7 RTM a try, you can take a 90 day trial now (32 and 64-bit versions available.)

Windows 7 - The Pocket Guide

Download Windows 7 Enterprise RTM

Automatically Delete Temporary Files in Windows 7 [How To]

Posted by Rich On September - 1 - 2009

The Windows Disk Cleanup Wizard will delete your temporary files, but only if they are over a week old. To create a simple batch script that will clean up your temporary directories, do the following (Vista instructions):

Creating the Batch File to Clean Temporary Files

  1. Open Notepad and type the following:

    cd C:\Users\%username%\AppData\Local
    rmdir /S /Q Temp

  2. Save the file as cleantemp.bat
    Automatically delete temporary files in Windows 7
  3. Now double click on the file to remove your temporary files and free up space on your computer

If this doesn’t work and gives an access error, try replacing %username% with you windows login username.

Automating the Process of Deleting Temporary Files

To automate this process, so you do not need to remember to run it, do the following:

  1. Right click on the batch file and select create shortcut
  2. Place the shortcut in your startup folder in the start menu

Now when you log in to Windows 7, your temporary files will be deleted.


Computer tips in your inbox
Sign up for the Windows Guides newsletter to get PC tips and access to free Windows books (More details)

Subscribe now
Popular Guides

See which sites have been visited on your PC (even if private browsing mode is used)

Create a Windows 7 System Repair Disc

Best Free Anti-malware

Hibernate vs. Sleep vs. Shut-Down

i3, i5, and i7; Dual, Quad, Hexa Core Processors. How to they Differ?

Intel's Ivy Bridge Processor: new Features

Submit Your Tip
Submit your computer tip to us; receive full credit for all published tips

Windows Guides on Facebook