Automatically Clean the Windows Temproary Folder using Batch File (makcode.in)

A lot of space are often saved on your disk drive by clearing the Temp file, and here’s how safely delete the temp files from the previous day during boot.

Windows always has temp files and other junk that’s just taking up space on your hard drive as temp folder

How to see temp file in windows open run – and type %temp% and press enter and you will see all temps files or folders.

After press ok button a temp folder were open

Now you can see many temp file are in these folder .

  • Now how to clean all temp file at one click of batch files
  • First open a notepad and paste the following code and save as tempdelete.bat
  • after create a bat file open tempdelete.bat and enjoy clean all temp data from temp folder
@echo off

Echo "preparing for deleting the TEMP files and Internet Cache"
Echo "Calculating Settings..."

Echo .
Echo "Deleting Temporary Files from your system FOR WIN 95/98/ME/NT..."
del "C:\WINDOWS\TEMP\*.*" /s /q /f
Echo %ERRORLEVEL%

Echo .
Echo "Deleting Temporary Internet Files from your system FOR WIN 95/98/ME/NT..."
del "C:\WINDOWS\Temporary Internet Files\*.*" /s /q /f
Echo %ERRORLEVEL%

Echo .
Echo "Deleting Downloaded Program Files from your system FOR WIN 95/98/ME/NT..."
del "C:\WINDOWS\Downloaded Program Files\*.*" /s /q /f
Echo %ERRORLEVEL%

Echo .
Echo "Deleting Cookies from your system FOR WIN 95/98/ME/NT..."
del "C:\WINDOWS\Cookies\*.*" /s /q /f
Echo %ERRORLEVEL%

Echo .
Echo "Deleting History from your system FOR WIN 95/98/ME/NT..."
del "C:\WINDOWS\History\*.*" /s /q /f
RD "C:\WINDOWS\History\History.IE5" /s /q
Echo %ERRORLEVEL%

Echo .
Echo "Deleting Temporary Files from your profile..."
del "%userprofile%\Local Settings\Temp\*.*" /s /q /f
RD "%userprofile%\Local Settings\Temp" /s /q
md "%userprofile%\Local Settings\Temp"
Echo %ERRORLEVEL%

Echo .
Echo "Deleting Temporary Files from your profile..."
del "%userprofile%\Local Settings\Temporary Internet Files\*.*" /s /q /f
Echo %ERRORLEVEL%


Echo .
Echo "Deleting Temporary Files from your system..."
del "%SystemDrive%\Temp\*.*" /s /q /f
Echo %ERRORLEVEL%

Echo .
Echo "Deleting Temporary Files from your system..."
del "%Systemroot%\Temp\*.*" /s /q /f
RD "%Systemroot%\Temp" /s /q
md "%Systemroot%\Temp"
Echo %ERRORLEVEL%


Echo .
Echo "Prefetch Files from your system..."
del "%Systemroot%\Prefetch\*.*" /s /q /f
RD "%Systemroot%\Prefetch" /s /q
md "%Systemroot%\Prefetch"
Echo %ERRORLEVEL%

Echo .
Echo "Deleting ALL Temporary Files from your system & Other's Users Profile ..."
del *.tmp /s/q/f/a:-h,h 

Echo .
Echo "Deleting Cookies from your profile..."
del "%userprofile%\Cookies\*.*" /s /q /f
RD "%userprofile%\Cookies" /s /q
md "%userprofile%\Cookies
Echo %ERRORLEVEL%

Echo .
Echo "Deleting History from your profile..."
del "%userprofile%\Local Settings\History\*.*" /s /q /f
RD "%userprofile%\Local Settings\History" /s /q
md "%userprofile%\Local Settings\History
Echo %ERRORLEVEL%

Echo .
Echo "Deleting My Recent Documents from your profile..."
del "%userprofile%\Recent\*.*" /s /q /f
RD "%userprofile%\Recent" /s /q
md "%userprofile%\Recent
Echo %ERRORLEVEL%

Echo .
Echo "Deleting Downloaded Program Files from your profile..."
del "%Systemroot%\Downloaded Program Files\*.*" /s /q /f
RD "%Systemroot%\Downloaded Program Files" /s /q
md "%Systemroot%\Downloaded Program Files
Echo %ERRORLEVEL%

Echo .
Echo "Deleting Citrix Cache from your profile ....."
del "%userprofile%\Application Data\ICAClient\Cache\*.*" /s /q /f
Echo %ERRORLEVEL%

Echo Completed...

Leave a Reply

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