Reply to comment

Who has files open on the network

The WhoHasFileOpen utility displays the list of users who have specific file(s) open on network. Works on Windows NT Platform (Windows NT 4.0, Windows 2000, etc). This code detects only the files opened using a net shared path. It does not return the files opened by a user on the local computer using a local path.

The code is based on Ramon F. Jaquez's UT FAQ #7896 Who opened what files on the network? (modified to use only VFP code).

Thanks Kevin Delaney for code cleanup which made possible to post it here for download .

The code uses Windows API support class which is included in the download WhoHasFileOpen.zip as well.

A user running this program must be a member of the Administrators or Account Operators local group on the file server where files are located.

This is sample code. Add error handling and adjust to your requirements as necessary.



Examples

* Mapped drive, specific file 'Sometable.dbf'
WhoHasFileOpen("X:\Somefolder\SumSubfolder\Sometable.dbf")
 
* Mapped drive, all extensions for specific file name 'Sometable'
WhoHasFileOpen("X:\Somefolder\SomeSubfolder\Sometable")
 
* UNC path, specific file 'Sometable.dbf'
WhoHasFileOpen("\\SomeServer\SomeShare\Somefolder\SomemSubfolder\Sometable.dbf")

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <java>, <powershell>, <tsql>, <visualfoxpro>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.