Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to determine if a file on another computer (or network) is currently being accessed. Ideally, I want to perform this task in a batch file, but other methods of performing this feat is welcomed. Also, if there a way to be notified when the file is not being accessed (locked) anymore? Thanks.


Edit: Sorry, I failed to mention the OS. This is on Windows based machines and primarily Windows XP SP2/SP3 machines.

share|improve this question
This depends greatly on the OS you are using. – KeithB Jul 26 '10 at 19:30

Not sure if this meets your needs.


share|improve this answer
Not exactly. Basically, I have a tester that is creating log files which a server collects during the day. There are times when the server is copying over the files though one may be currently locked. My IT person is looking for a way to determine if the test program still has a lock (or has the file open for writing). Ideally, I don't want to use any third party utilities if I can help it as my IT person doesn't want to install anything on the server. – lordhog Jul 26 '10 at 22:45
Going to be hard to do without software, at least for me, here is a utility from microsoft that may reveal what process or program has a file locked. – Moab Jul 27 '10 at 14:03
I was looking at "PsExec" and "Handle" to attempt this feat. If running the "Handle" program locally the program will show which process has a handle of the input criteria. I then tried executing "Handle" remotely by using the following snytax: psexec \\ -u "doman\user" -p "password" -c handle.exe "FileToCheck.ext" Which executed the program, but the only problem is that "PsExec" only returns the exit code. I had not figured out how to retrieve any info if a handle was found. – lordhog Jul 27 '10 at 23:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.