No announcement yet.

How to tell who has a file locked?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to tell who has a file locked?

    How can I get more information about a file that I am trying to open and lock that is already open by another user on the network? I get an error 70 when trying to open the file. I would lke to be able to tell the user which user and what station on the network has the file opened.
    Last edited by Douglas Martin; 5 Mar 2008, 06:27 AM. Reason: spelling

  • #2
    This has come up here before.

    UNless I am mistaken, someone came up with a solution, but it used one of the "Don't use this API unless desperate" functions. I think the function was something like "NTQuerySystemInformation" or "NTQueryHandles, " something like that.

    I'm pretty sure the function name started with "NtQuery" so you could try a search here on that token.

    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]


    • #3
      Not sure if the following would give enough information. It was listed in my RSS feeds yesterday and I have it on-board right now.



      • #4
        Both Pierre, and myself did this line not far back. But MCM is correct, it is using "UnDocumented" API calls (Although they exist, no guarantee they work, or are available on on OS systems, nor in the future)

        It was about late August of last year, but we each posted to the Source Code Forum. (I think it was before the PB Change because I can not find my code in search, but found Pierre's at NtQuerySystemInformation with %SystemHandleInformation

        Maybe someone elses search will turn up more. But I believe Pierre's and my code will get you close, but I don't think either of us did the same for a process on a remote computer just yet.
        Engineer's Motto: If it aint broke take it apart and fix it

        "If at 1st you don't succeed... call it version 1.0"

        "Half of Programming is coding"....."The other 90% is DEBUGGING"

        "Document my code????" .... "WHYYY??? do you think they call it CODE? "