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.

Mark

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

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

1 Answer

Not sure if this meets your needs.

http://www.thecodeline.com/ShareWatcher.aspx

.

link|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. technet.microsoft.com/en-us/sysinternals/bb896645.aspx – 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 \\10.0.0.1 -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
feedback

Your Answer

 
or
required, but never shown

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