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
Solved

Who is using a file on the network

Posted on 2000-04-03
3
188 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 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