2

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?

Behrang
  • 279
  • 2
  • 3
  • 10

5 Answers5

6

Try Process Explorer (or Handle if you like CLI). You can get them both from Sysinternals

maristgeek
  • 314
  • 1
  • 2
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

Thomas Berger
  • 1,700
  • 12
  • 22
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.

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
Gaute Lund
  • 11
  • 1
0

Not an answer, but an observation... EXPLORER.EXE has a nasty habit of locking files. HANDLE.EXE is a very good tool.

Simon Catlin
  • 5,222
  • 3
  • 16
  • 20
0

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.

mgorven
  • 30,036
  • 7
  • 76
  • 121
Elliott Shafii
  • 33
  • 1
  • 1
  • 4