WNetAddConnection2 - "The network path was not found"
Posted on 2001-08-23
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,
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.