How to Delete Temporary Internet Files Command-Line or Command Prompt Easily. Generally, all temporary internet files are located on the user account on Windows. If you wanna delete all internet files, just follow by 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 ownership of this file for detailed information on this command.
Once you open the folder in Explorer and just delete the files. You need to run the below command.
By this command 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 the above two commands only. But keep the root folder untouched.
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.
forfiles /P %userprofile%\AppData\Local\Temp\ /C "cmd /c if @isdir==TRUE rmdir /S /Q @file"
You can also verify to points in this folder that the environment variables
c:\>set t TEMP=C:\Users\loginId\AppData\Local\Temp TMP=C:\Users\loginId\AppData\Local\Temp
So, deletion of temp files can also use by the below command.
forfiles /P %TEMP%\* /C "cmd /c if @isdir==TRUE rmdir /S /Q @file"
Read Also: How to Reboot Windows from PowerShell
Last Updated on 5 months by Max