Clear Temporary Data With Batch File In One Click

Clear Temporary Data With Batch File In One Click

Clear Temporary Data With Batch File In One Click

Clear Temporary Data With Batch File In One Click


To delete temporary files like "temp, %temp%, prefetch in one click rather then doing one by one.

Follow below simple steps :-

1) Open Notepad and copy the below script. Below mention scripts is not created by me its an internet source with 100% working.

@echo off
del /s /f /q %windir%\temp\.    
rd /s /q %windir%\temp    
md %windir%\temp    
del /s /f /q %windir%\Prefetch\.    
rd /s /q %windir%\Prefetch    
md %windir%\Prefetch
del /s /f /q "%SysteDrive%\Temp"\.    
rd /s /q "%SysteDrive%\Temp"    
md "%SysteDrive%\Temp"    
del /s /f /q %temp%\.    
rd /s /q %temp%    
md %temp%
deltree /y c:\windows\tempor~1
 deltree /y c:\windows\temp
 deltree /y c:\windows\tmp
 deltree /y c:\windows\ff*.tmp
 deltree /y c:\windows\prefetch
cls

2) Save file as clear.bat (.bat is file extension ). You can give file name as your choice but after name type ( .bat ).
Batch file



3) Now double click on the batch file and run it will delete all the temporary files except which are in use that files will be there in temp folder. For deleting those just close the application those are open and re run the batch and check.

4) Now if you want to set this batch file to run automatically in background with particular interval of time then you can schedule a task for this.

5) Open task Scheduler ( start menu\program\windows administrative tools )  and create basic task.
Task Scheduler

6) Now name task as clear or as your choice and click next,
Task Scheduler

7) Select trigger as daily and click next,
Task Scheduler

8) Set time when you want to start batch file to run and click next,
Task Scheduler

9) In action select start a program and click next,
Task Scheduler

10) Now select the clear.bat file from the saved drive location and click next,
Task Scheduler

11) Lastly check and click on finish.
Task Scheduler


A task has been schedule with clear.bat scripts which will run on daily in background.

THANKYOU.










0 Response to "Clear Temporary Data With Batch File In One Click"

Post a Comment