Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > Miscellaneous Utilities
  New Posts New Posts RSS Feed - handle.exe "Error closing handle:" invalid handle
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

handle.exe "Error closing handle:" invalid handle

 Post Reply Post Reply
Author
Message
MapsonJohn View Drop Down
Newbie
Newbie


Joined: 25 March 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote MapsonJohn Quote  Post ReplyReply Direct Link To This Post Topic: handle.exe "Error closing handle:" invalid handle
    Posted: 25 March 2011 at 2:54pm
Hey,

I have a folder that I can't delete because it is "locked by another application"

I've identified the PID and Handle ID:
System             pid: 4      type: File          1C20: H:\..................

And tried to close it with:
handle -c 1c20 -p 4

I'm getting the following error:
Error closing handle:
The handle is invalid.

I'm getting only one (irrelevant) google hit for
handle.exe "Error closing handle:" "The handle is invalid"

Hence, this post...
Back to Top
MapsonJohn View Drop Down
Newbie
Newbie


Joined: 25 March 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote MapsonJohn Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2011 at 9:38am
No one with a clue?
Back to Top
glm_jbi View Drop Down
Newbie
Newbie


Joined: 01 April 2011
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote glm_jbi Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2011 at 2:18pm
Also interested if anyone get a clue
I'm moved form Handle v3.42 to v3.45 and I get the same issue while trying to kill any system handle (pid 4)

Originally posted by chinaloong chinaloong wrote:

may be google will be help you,hh



OMG, we should have thought about it !!!

:/
Back to Top
MapsonJohn View Drop Down
Newbie
Newbie


Joined: 25 March 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote MapsonJohn Quote  Post ReplyReply Direct Link To This Post Posted: 04 April 2011 at 8:56am
glm_jbi, 
interesting find. So it's probably with any handle by pid 4 (being the System process).
This sounds like it could make sense. Maybe a more advanced user can tell us if it's normal that handle.exe is not able to close System handles.

Anyone?
Back to Top
MattG View Drop Down
Newbie
Newbie


Joined: 28 May 2012
Location: Australia
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote MattG Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2012 at 3:03am
Still no updates on this critical issue. Fundamentally it means that handle.exe the tool supplied by MS to close a file handle on their OS does not work. I have been lucky enough to be at Linux sites for the last few years, however I am doing some MS work at the moment and I am amazed how MS just falls further and further behind...

Anyway, rant over. Is there a work around / alternative / explanation or anything else. Is SysInternals aware of this bug, or is this an OS feature.

Problem is trivial to replicate.
1) Create a dir
2) Share it as a network share
3) Create a file in the dir
4) Open the file via the network share (you can still do this locally using Start / Run / \\hostname then open the share name
5) Run handle.exe againt the file and try to close all file handles

Yes, I have tried the  openfiles command :
openfiles /disconnect /a * /OP LockedFile.txt
But it does nothing

openfile /query does not show the file handle

Sysinternals Handle.exe Output
C:\Windows\System32\drivers\etc>handle C:\Log\LockedFile.txt

Handle v3.46
Copyright (C) 1997-2011 Mark Russinovich
Sysinternals - www.sysinternals.com

System             pid: 4      type: File          3BE8:  C:\Log\LockedFile.txt
System             pid: 4      type: File          40C0: C:\Log\LockedFile.txt

C:\Windows\System32\drivers\etc>handle.exe -c 3BE8 -p 4 -y

Handle v3.46
Copyright (C) 1997-2011 Mark Russinovich
Sysinternals - www.sysinternals.com

 3BE8: File  (RW-)   C:\Log\LockedFile.txt
Error closing handle:
The handle is invalid.


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down