fbpx
× Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET

Find who has a shared file open on network

More
2 months 3 weeks ago #1 by Jamal
Hi,

I wonder if anyone created a function (C#, VO or X#) to find out which workstation or user has a shared file open on local area network.

The issue arises when I need to index DBF files, then admin has to go to every workstation and see which has the program open and close all windows or exit the program.

Thanks,
Jamal

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #2 by Stefan Hirsch
Replied by Stefan Hirsch on topic Find who has a shared file open on network
Hi Jamal,

not exactly what you are looking for:
I have the very same problem. Indexing DBFs or updating the app requires closing all running instances.
I create a little file with a fix filename (_CLOSE_ALL_.xxx). The apps are polling once a minute for this file. If it exists the app closes itself. Maybe this approach can help in the future.

Stefan

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #3 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic Find who has a shared file open on network
Hi Jamal,

the administrator can look on the server who has a file open, and close it when neccessary.

In my programs, I have implemented a setting. If it is set, all clients close down itself. This works very well.

Wolfgang

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #4 by Jamal
Replied by Jamal on topic Find who has a shared file open on network
Hi Stefan and Wolfgang,

I was thinking about implementing a timer that sends a message to workstations to close down in a couple of minutes after a warning is display of an imminent shutdown. However, sometimes a file may get "stuck" open (due to a possible crash) and it be would great to know which station has the file still open.

Jamal

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #5 by Jamal
Replied by Jamal on topic Find who has a shared file open on network
Hi Wolfgang,

>> the administrator can look on the server who has a file open, and close it when necessary. >>

Which tool is used to see that info? Let say on Windows Server 2012 or 2016.

Jamal

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #6 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic Find who has a shared file open on network
Hi Jamal,

I have only a German version to look.
In the System Managment applet there is a choice called "Shared Folders", and then "Open Files".

Wolfgang

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #7 by Jamal
Replied by Jamal on topic Find who has a shared file open on network
Thanks Wolfgang, will check it out.

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #8 by Gerhard Bunzel
Replied by Gerhard Bunzel on topic Find who has a shared file open on network
Jamal,

you can also use the Windwos API NetFileEnum to get some or all open files.
docs.microsoft.com/en-us/windows/desktop...-lmshare-netfileenum

HTH

Gerhard

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #9 by Karl-Heinz Rauscher
Replied by Karl-Heinz Rauscher on topic Find who has a shared file open on network
Hi Jamal,

the attached zip contains a very old aef of mine that uses NetFileEnum() to show opened files in a listview. The app worked at least with a w2k Server.

I only made some minor changes ( adding missing return values etc. ) to compile the aef with VO 2.8. Currently it seems , though NetFileEnum() returns NERR_Success, that the params @dwEntriesread, @dwTotalentries are always 0. I do not have the time to take a closer look, but maybe you or someone else can make it work again ?

regards
Karl-Heinz
Attachments:

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #10 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic Find who has a shared file open on network
Hi Karl-Heinz,

according to the Microsoft documentation this works only if the current user has domain administrator rights or server administrator rights.

I have no server at customers sites where a local workstation user has these rights.

Wolfgang

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #11 by Arne Ortlinghaus
Replied by Arne Ortlinghaus on topic Find who has a shared file open on network
Hi Wolfgang,
I think it is this the limitation: Knowing who has open files needs Windows admin rights. And this makes sense, because knowing which files are open could be already a sufficient information for attackers or spys.

Arne

Please Log in or Create an account to join the conversation.