Creating the Batch File to Clean Temporary Files in Windows7


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
- Open Notepad and type the following:
cd C:\Users\%username%\AppData\Local
rmdir /S /Q Temp - Save the file as deletemp.bat
- Now double click on the file to remove your temporary files and free up space on your computer.
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
- Right click on the batch file and select create shortcut
- Right click on deletemp.bat shortcut and select properties
- Select Run option as minimized (see picture) click apply then OK
- Move deletemp.bat shortcut to your Startup folder in the start menu.
If you don't know where is the Startup folder just do the following
- Click on Windows start orb which is placed at left bottom corner of monitor.
- Click all programmes
- Look Down Where comes Startup as alphabetically (Remember it is a folder not a program )
- Just drag & drop deletemp.bat
0 comments:
Post a Comment