When I want to delete a file, Windows complains that it is open in another program. How can I find the program so that I can close it or force the file to be deleted?
5 Answers
Try Process Explorer (or Handle if you like CLI). You can get them both from Sysinternals
- 314
- 1
- 2
open a command prompt with elevation and type in:
for /f "skip=4 tokens=1" %a in ('net files') do net files %a /close
The files should be closed and you can delete them
- 1,700
- 12
- 22
- 21
- 1
+1 for unlocker, which has a new site.
I can also recommend LockHunter and OpenedFilesView, especially LockHunter. I sometimes find files said to be locked, there is no process locking them and unlocking-apps say so. Others can't delete it, but LockHunter can.
Though Unlocker has the option to "delete on reboot" if all else fails.
- 53,385
- 32
- 133
- 208
- 11
- 1
Not an answer, but an observation... EXPLORER.EXE has a nasty habit of locking files. HANDLE.EXE is a very good tool.
- 5,222
- 3
- 16
- 20
I'd try this software if you're still having problems. It's free and give you a list of the processes blocking the delete with options to kill process etc.
Or you could try killbox (just Google killbox) again same sort of thing but you don't need to install killbox.
- 30,036
- 7
- 76
- 121
- 33
- 1
- 1
- 4