dagblog.
← Archive

You can’t delete it, you can’t … and then you can


Has Windows ever given you
 the message “Unable to delete file” when you tried to delete one? It’s especially annoying if you aren’t aware 
of any application still open that might be holding the file. It can be a real 
problem if deleting, or more accurately failing to delete, the file holds up your work.

Fortunately, Windows has a tool called Open Handles
 (part of the Resource Kit) that can list the processes holding the file. One small downside is that 
 you have to restart the system before the utility can provide any information. If you don’t want to keep typing the path to the utility, 
add it to PATH.

So what does the output look like when the utility does its job?

C:\Tools\Ant\bin>oh ant
0000081C TOTALCMD.EXE File 017c \Tools\Ant\bin
00000770 CMD.EXE File 0018 \Tools\Ant\bin
00000634 oh.exe File 0018 \Tools\Ant\bin

Medium version

Related articles

Related CZ Podcast episodes