I am looking for a vbscript that tells me whether a file is being used by some process or not.

Example: xyz.exe is currently being used in javaw.exe

Your help would be greatly appreciated.
0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


Tried Google? I found this in 0.22 seconds.

I just thought of another thing to try. Turn off error-checking (On Error Resume Next) and attempt to open it. If you get error 55 (I think it's 55...), the file is open by some other process.

I don't think there's a native way in VBScript to determine what process has the file open. For that, I think you'd need to get into retrieving file handles and then using a Windows API to match that against process IDs. Again, there's no native access to Windows APIs so you'd need something like DynaWrap... :(
Answered 03/19/2010 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity