Retrieve all shares on a server?

dmoonme

New member
Joined
Jul 8, 2004
Messages
4
Programming Experience
1-3
I have 50 shares on a server, \\server\share1 ,\\server\share2, ...,\\server\share50.

I could statically add the names of each 50 shares to run on my script but I don't want to do that. Is there a way to retrieve all shares on a server dynamically/programmatically? Is there an API that I could use?

Here's what i have so far
VB.NET:
Dim names as ArrayList names = New ArrayList() 
names.add([url="file:///crwfs1Data1"][color=#000020]\\crwfs1\Data1[/color][/url])  'statically added names
names.add([url="file:///crwfs1CMSOPEN"][color=#000020]\\crwfs1\CMSOPEN[/color][/url]) 
names.add([url="file:///crwfs1Correspondence"][color=#000020]\\crwfs1\Correspondence[/color][/url]) 
names.add([url="file:///crwfs1Data"][color=#000020]\\crwfs1\Data[/color][/url]) 
 
Dim strItem as String 
 
For Each strItem In names 
ListDirs(strItem) 'call my function
Next
 
Back
Top