?
Solved

Who is using a file on the network

Posted on 2000-04-03
3
Medium Priority
?
198 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 200 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
Suggested Courses

770 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