-2

I need to get a list of all shares on a network device including the hidden ones. I write a network device since it may be a NAS, a Windows server or a Linux server

I have seen some samples and have tried some of them, but not one that gives me the list I need. Most of them only list the devices and not the shares.

OZ8HP
  • 1,443
  • 4
  • 31
  • 61
  • Possible Duplicate of http://stackoverflow.com/questions/899995/win32-api-calls-to-list-available-network-shares-on-a-server – Remko Nov 07 '12 at 10:47

1 Answers1

0

maybe you can somehow use / capture the output of the "net view" cmd command ?

for example try the following in a command prompt

"net view \\IP /ALL"

"net view \\192.168.150.100 /ALL"

i know there are ways to get the commandline output so you could possible parse them, if taking this approach you'll also have to account for security, net view can possible return error codes if you do not have access. I do not know however how to do the same just using code (without an external program)

Community
  • 1
  • 1
Willems Davy
  • 105
  • 8
  • 3
    -1 there are api's for that, parsing a commandline is IMHO a bad way (for instance if language differs what happens). – Remko Nov 07 '12 at 10:44