Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enumerate shares at \\machine_name\

Status
Not open for further replies.

Vachaun22

Programmer
Oct 7, 2003
171
0
0
US
I am looking for a way to list the shares of a remote machine. Using WMI works, but it's actually too robust because it returns special shares, and shares that don't appear if you navigate to \\machine_name in explorer.

I only want to be able to retrieve the shares that are shown when you navigate to the machine UNC path because I do not want to allow people to attempt to map special shares, since this will obviously fail, and is not what is expected behavior.

I tried using a DirectoryInfo object setting the path to be the machine name only, but it expects a path in the form of:

\\machine_name\share

But I simply want to list everything that is a folder under

\\machine_name

Does anyone happen to know how to do this? I've been searching for probably over a week now, and just coming up empty with the exception of the WMI stuff.

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top