Solved

Who is using a file on the network

Posted on 2000-04-03
3
189 Views
Last Modified: 2008-02-20
I want to know, say by selecting a file from a cmdlg, to display a window showing what users have a particualar file open.  I think there might be an API available.

I want this to work on a NT/Windows network.

many thanks
Celo
0
Comment
Question by:celo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
monteh earned 100 total points
ID: 2684871
You can use the NetFileGetInfo function but it is tricky.

There are limitations. That is, it will only work for NT machines, and only if the file was opened using the shared resource. If the file was opened via "c:\program files\my program\readme.txt" then it won't work.
0
 

Author Comment

by:celo
ID: 2685538
Will if work on machines running win95 accessing files on the network, if so an you supply an example
0
 

Expert Comment

by:monteh
ID: 2685608
Actually, the function is NetFileEnum, and yes it will work for NT and Win9X but you need to handle the differences.

The MSDN documents the NT version but not the Win9X version. You need to review the header file for the Win9X version (see svrapi.h). The Win9X version is exported in SVRAPI.DLL  while the NT version is exported in NETAPI32.DLL.

There's a sample of the NetFileEnum function (NT version only) on my website (see the Grab Bag page).

http://KillerVB.Com


Monte Hansen
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question