1

Consider that i have connected to multiple shares of a remote machine( \\machineA\share1, \\machineA\share2....) along with shares on other remote machines.

Now my question is how to find only those shares which are connected to a particular machine. For eg, only those shares which are connected to machineA.

I already came across WNetOpenEnum and WNetEnumResource. But these are highly inefficient that they will return all shares which are connected to my machine and then i will have to search through the results for the shares connected to machineA:(

I need to know if there is some other function, using which i can find the share.

I am working on VC++ 6.0.

edit: Hey guys having another trouble. Whenever i try to connect to a share on the machine i get the following error: "The referenced account is currently locked out and may not be logged on to" Has anyone encountered this problem and how was it solved

Raghu
  • 190
  • 1
  • 4
  • 10
  • Please ask one question in one post, don't add your lockout problem to the list of shares problem - they are not related. – Werner Henze Jul 03 '13 at 11:27

3 Answers3

1

To resolve your lockout problem, log onto a the target server (Or, if it's on a domain, log onto any domain controller on that domain), go to Control Panel > Administrative Tools > Active Directory Users & Computers, navigate to the User you're logging in as, and unlock it.

If the system is not on a domain, simply log onto it and unlock the account via the "Local users & Groups" tool in compmgmt.msc.

tsilb
  • 7,977
  • 13
  • 71
  • 98
  • When someone answers your question and the answer is helpful, you're expected to return the favor by clicking the 'up' arrow to the left of the post. – tsilb Feb 15 '09 at 08:13
0

Iterating through all shares and only picking the ones you want, to me, looks as efficient as it gets. Is there some circumstance why you can't do it? (except laziness ;))

Piskvor left the building
  • 91,498
  • 46
  • 177
  • 222
0
foreach (string systemName in systemNames)
 System.IO.Directory.GetDirectories("\\"+systemName+"\");
tsilb
  • 7,977
  • 13
  • 71
  • 98