Labels

Creating the Batch File to Clean Temporary Files in Windows7

pardhans 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
 These steps are written for  Windows 7 and Vista version

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 



  1. Open Notepad and type the following:
    cd C:\Users\%username%\AppData\Local
    rmdir /S /Q Temp
  2. Save the file as deletemp.bat
  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. 
 Example : If username = govind
the code will be

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

Oops Not Working? But How do you know is it work or not?
Just double click any folder on your computer
Now explorer will open
Type on address bar %Temp% then enter

Now it will go to temp folder

You got it....
Now test your deletemp.bat
If  it is not deleting temp files change your code once more with

 @echo off
rmdir /s /q "%Temp%"

Copy paste or write this code exactly as it is
Now it will work

Auto Delete Temporary Files at Startup


If you automate this process, you do not need to remember to run it always.
Follow these steps to automate this process
  1. Right click on the batch file and select create shortcut
  2. Right click on deletemp.bat shortcut and select properties
  3. Select Run option as minimized (see picture) click apply then OK
  4. Move deletemp.bat shortcut to your Startup folder in the start menu. 

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

    If you don't know where is the Startup folder just do the following

    1.       Click on Windows start orb which is placed at left bottom corner of monitor.
    2.       Click all programmes
    3.       Look Down Where comes Startup as alphabetically (Remember it is a folder not a program )
    4.      Just drag & drop deletemp.bat
       

    0 comments:

    Popular Posts

    Login

    Add This Widget