I want to get the result I am able to get by typing “net file” in console.
I have tried to find a way to get the information I need through WMI Win32 Classes, but it seams to me that I can’t list the actual resources in use. The closest I have come is to use Win32_ServerSession, where i can list the shares that has connections, but not the resource itself.
Is there something I have missed, how can I get my result?
Edit:
I can’t use “net file”, because the strings are being truncated if the path is long.
Example:
D:\shares\files\photo\image.jpg will be listed as D:\share\…\image.jpg
The same list of files, but with full path, can be found under Computer Management -> System Tools -> Shared Folders -> Open Files
Thanks to Manfred, i got this working. If you got the same problem, Get the code from here.