Solved

WNetAddConnection2 - "The network path was not found"

Posted on 2001-08-23
12
3,204 Views
Last Modified: 2007-11-27
I'm trying to use a modem to RAS into a server and map a drive. The RasDial() connects and authenticates fine, but when I actually try to map a drive, it fails.

Here's what I'm doing once I connect:

   nrServer.dwType = RESOURCETYPE_ANY;
   nrServer.lpLocalName = L"Z:";
   nrServer.lpRemoteName = L"\\MyServer\MyPath";
   nrServer.lpProvider = L"";

   dwError = WNetAddConnection2(&nrServer,
                                L"MyPassword",
                                L"MyUserName", 0);

This fails with dwError = 0x35 - 'The network path was not found.'

It is on our corporate network and if I call WNetAddConnection2() from a machine with an ethernet connection, it maps fine...

I've heard that there may be a configuration on some networks where the password and user name need to be reversed in WNetAddConnection2() but when I try that & get an error about an incorrect password (duh...). If I leave the password and user out, I get the same 0x35 error.

Any advice?
0
Comment
Question by:Grailman
12 Comments
 
LVL 1

Author Comment

by:Grailman
ID: 6420056
Actually the remote name was \\\\MyServer\\MyPath

MyBad ;-o
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6420058
I'm not where I can test this, but does it make any difference if you use RESOURCETYPE_DISK ?

I read that error 53 (0x35) is often used as a grab bag since in NT 3x, it would force an immediate halt to some time-consuming network operations.  If that's what's happening, there might be a security issue involved.  If the server thinks that you have no right poking your nose around, it might be using this error to preempt you out of the system.

Do you have any trouble if you use Dialup Networking to logon to that server manually?  If you have not tried it, do so -- the popup error messages could be enlightening.  During the login, you may need to specify a Domain name and/or a valid username/password (recognized by the server)  

And to connect to a drive share, that user name might need to have specific privileges on the specified sharename.

See what happens with the above suggestions.  If you're still having problems, I have some ways to test this out tomorrow.

BTW -- what OS is the host and what OS is the client?

-- Dan
0
 
LVL 1

Author Comment

by:Grailman
ID: 6420074
Actually the remote name was \\\\MyServer\\MyPath

MyBad ;-o
0
 
LVL 1

Author Comment

by:Grailman
ID: 6420255
I can connect w/ Dial-up Networking and I get a message that:

"You have successfully connected to the remote server. You may now use the usual Windows NT programs and utilities as if you were directly connected to the network"

When I go to Windows Explorer I see a couple (out of say 2 dozen) of machines on the network but when I click them, I get an error "The network path was not found"

The host is either NT4 or W2K and the client is NT4 with SP5.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6420328
I think that narrows it down to a security issue.  In the Dialup networking, what protocols are in effect?  You could try eliminating all except for NetBeui to try to force a fallback the good old days of Workgroup style security.

Also, the login username and password (and Domain) from the username password prompt must match what is expected by the host.  For testing, add this user to the host and give him administrator priveledges.  Also verify that the shared directory on the host provides full access to everybody on earth.

Check your RAS settings as to what permisssions the dialup connections will receive.

-- Dan
0
 
LVL 1

Author Comment

by:Grailman
ID: 6420639
I can connect w/ Dial-up Networking and I get a message that:

"You have successfully connected to the remote server. You may now use the usual Windows NT programs and utilities as if you were directly connected to the network"

When I go to Windows Explorer I see a couple (out of say 2 dozen) of machines on the network but when I click them, I get an error "The network path was not found"

The host is either NT4 or W2K and the client is NT4 with SP5.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 49

Expert Comment

by:DanRollins
ID: 6420722
do i hear an echo?

-- Dan
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 6420874
Listening...
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 0 total points
ID: 6420887
0
 
LVL 1

Author Comment

by:Grailman
ID: 6432173
Found it!

It turned out that the NIC I had in my machine was bound to the same network as the machine I wanted to map to. Remember I said I could map using the NIC? Well when I unplugged the cable and tried to map after I had made a modem connection, my machine still tried to use the NIC since the networks were the same. Once I released the NIC adapter I was able to map just fine using the modem connection.

Note: I would not have seen this situation if I had tried it on one of our machines in the field since their NIC adapters are bound to another network... DOOH!
0
 
LVL 1

Author Comment

by:Grailman
ID: 6432196
Found it!

It turned out that the NIC I had in my machine was bound to the same network as the machine I wanted to map to. Remember I said I could map using the NIC? Well when I unplugged the cable and tried to map after I had made a modem connection, my machine still tried to use the NIC since the networks were the same. Once I released the NIC adapter I was able to map just fine using the modem connection.

Note: I would not have seen this situation if I had tried it on one of our machines in the field since their NIC adapters are bound to another network... DOOH!
0
 
LVL 3

Expert Comment

by:modder
ID: 6432467
Grailman, as requested I have refunded your points. I've accepted AlexVirochovsky's comment to make it a PAQ. Sorry, Alex, no points, but at least a nice "A" to show in your profile ;-)

modder
Community Support
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now