fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC: Find who has a shared file open on network

Find who has a shared file open on network 4 months 3 weeks ago #1

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.

Find who has a shared file open on network 4 months 3 weeks ago #2

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.

Find who has a shared file open on network 4 months 3 weeks ago #3

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1423
  • Karma: 6
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
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

Find who has a shared file open on network 4 months 3 weeks ago #4

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.

Find who has a shared file open on network 4 months 3 weeks ago #5

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.

Find who has a shared file open on network 4 months 3 weeks ago #6

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1423
  • Karma: 6
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
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

Find who has a shared file open on network 4 months 3 weeks ago #7

Thanks Wolfgang, will check it out.

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

Find who has a shared file open on network 4 months 3 weeks ago #8

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.

Find who has a shared file open on network 4 months 3 weeks ago #9

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.

Find who has a shared file open on network 4 months 3 weeks ago #10

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1423
  • Karma: 6
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
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

Find who has a shared file open on network 3 months 3 weeks ago #11

  • ArneOrtlinghaus
  • ArneOrtlinghaus's Avatar
  • Offline
  • Posts: 124
  • Karma: 1
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.

  • Page:
  • 1