How to Delete Temporary Internet Files Command Line

How to Delete Temporary Internet Files Command Line or Command Prompt Easily. Generally, all temporary internet files located on the user account on Windows. If you wanna to delete all internet files, just following by command line.
How to Delete Temporary Internet Files Command Line

How to Delete Temporary Internet Files on Windows 7 –

If you are a Windows 7 user, just follow some steps below –
We know normally internet temporary files are stored in the folder AppData\Local\Temporary Internet Files. Now, you need to delete these files, so you need to take ownership of the folder and its files. Just run the command below –

takeown  /R /F  "%userprofile%\AppData\Local\Temporary Internet Files"

Need to take the ownership of this file for detailed information on this command.

Read Also: How to Run Command Prompt as an Administrator

Once you open the folder in Explorer and just delete the files. You need to run below command.

By this command to delete the files in the folder.

del "%userprofile%\AppData\Local\Temporary Internet Files\*"

By this command to delete the subfolders in Temporary Internet Files.

forfiles /P "%userprofile%\AppData\Local\Temporary Internet Files\*" /C "cmd /c if @isdir==TRUE rmdir /S /Q @file"

If you delete the whole directory, you need to use just above two commands only. But keep the root folder and untouched it.

Read Also: How to Create Unique Named File From Batch Script

How to delete application temporary files –

For Windows 7, all various applications of temporary files keep in the located folder AppData\Local\Temp. If you want to delete this cache, just run the below command.

del %userprofile%\AppData\Local\Temp\*
forfiles /P %userprofile%\AppData\Local\Temp\ /C "cmd /c if @isdir==TRUE rmdir /S /Q @file"

You can also verify to points this folder that the environment variables TEMP or TMP.

c:\>set t
TEMP=C:\Users\loginId\AppData\Local\Temp
TMP=C:\Users\loginId\AppData\Local\Temp

So, deletion of temp files can also using by below command.

del %TEMP%\*
forfiles /P %TEMP%\* /C "cmd /c if @isdir==TRUE rmdir /S /Q @file"

Read Also: How to Reboot Windows from PowerShell

You may also like...

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.