Windows 8 Cannot delete file, "file is open in Windows Explorer"

usermn

Senior Member
I use Windows 8.1 64-bit and sometimes I have attempted to use Internet Explorer 11. I'm the sole user and administrator on the computer.

Under Windows Explorer, I tried to delete the file
C:\Users\<username>\AppData\Local\Microsoft\Windows\INetCache\counters.dat

Windows Explorer gives a File In Use complaint
The action can't be completed because the file is open in Windows Explorer. Close the file and try again.

According to Advanced Security Settings for counters.dat, I am the owner of the file and I have full control over the file.

I closed the Windows Explorer window and ran cmd as administrator. I tried to delete the file and got the complaint
C:\Users\<username>\AppData\Local\Microsoft\Windows\INetCache\counters.dat
The process cannot access the file because it is being used by another process.

The same happens in Safe Mode.

How do I get rid of the file?
 
Why are you trying to delete it?

Whatever the case, if you wanted to delete it you would need to close all file handles to the file before you could delete it.
 
I'm trying to delete all IE cache/temp files. It's also a question of principle that I should be able to delete whatever files I want on a computer where I'm the only user and admin. For this forum I simplified the problem by mentioning one file only.

How do I close file handles?

According to Task Manager in Safe Mode, the following processes are running:
Task Manager
Windows Explorer
COM Surrogate
CTF Loader
Client Server Runtime Process
Client Server Runtime Process
Desktop Window Manager
Local Security Authority Process
Service Host: DCOM Server Process Launcher (6)
Service Host: Local Service (Network Restricted)
Service Host: Local System (2)
Service Host: Network Service
Service Host: Remote Procedure Call (2)
Services and Controller app
System
System Interrupts
Windows Logon Application
Windows Session Manager
Windows Start-Up Application

Ending Windows Explorer makes me unable to do much.
 
Last edited:
I studied some of the troublesome MS-DOS syntax and booted into Safe Mode with Command Prompt. I was able to remove IE cache files. Of course it would be easier if one could remove files in the normal state of Windows.
 
You can delete any file you want provided there are no open handles to them. You'll need to use procexp to find and close handles to that file and delete it.
 
Back
Top