Rick Strahl's Web Log

Wind, waves, code and everything in between...
ASP.NET • C# • HTML5 • JavaScript • AngularJs
Contact   •   Articles   •   Products   •   Support   •   Search
Ad-free experience sponsored by:
ASPOSE - the market leader of .NET and Java APIs for file formats – natively work with DOCX, XLSX, PPT, PDF, images and more

UNC Drive Mapping Failures: Network name cannot be found


Yesterday I was working with a customer on setting up a remote map from my machine to a VPN drive on a remote server on the VPN. Typically you can just map a drive or directly enter a UNC path to the server:

\\113.111.111.111\myshare

Typically that works just fine, but yesterday I noticed that it didn't work. Further, it failed immediately with:

Network path cannot be found

Now there can be a number of problems that can cause this - like a connection issue, adapter configuration etc. - but in this case the behavior was very different that what I'd seen before:

  • The attempt to connect failed immediately (no checking on the network it seems)
  • Even though I checked Use different credentials the Login dialog did never pop up to prompt for credentials
  • Even trying to access drives on the local, internal network would fail
  • Trying to use the Network discovery dialog to access resources listed all failed immediately

This was very frustrating because network connections for all internet protocols and messaging have been working just fine - it's just that all the Windows based network mapping/location features failed immediately.

I smelled a rat right away given the immediate error message without delay and the fact that there was no login dialog ever brought up.

The Problem: Network Provider Order

After a bit more research I ran into an obscure Technet Forums post that discusses a similar case. The resolution in there is that the Network Provider order causes this sort of problem - if the provider order does not include LanMan in the first entries it doesn't work.

Promptly I checked my machine's settings at:

HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order

what I found looked like this:

ProviderOrderInRegEditor

Notice the two empty entries in the order!

I changed the value to a more sane looking setting:

LanmanWorkstation,RDPNP,webclient

and that worked! Not sure what WebClient is but I didn't remove it - I suspect it's not required so don't add it if it wasn't there on your config in the first place.

Several other people have reported they've seen similar problems. Empty entries, LanmanWorkstations name truncated or mangled and even missing. Or other providers in front that are no longer installed.

The forum post mentions that other providers might sit in front of LanManWorkStation which is the provider responsible for managing network connections. To fix this I removed the two empty entries and moved LanmanWorkStation to the front of the list and low and behold I get my login dialog back and was able to connect to the remote machine.

Not sure how this got munged, but I suspect custom VPN clients have something to do with this. Over the last few months I've had to install several different VPN clients to connect to customer's private VPN networks - installing and uninstalling the clients and I suspect somewhere in that process the provider entry in the registry got munged.

Provider Order Dialog

Thanks to Richard (in comments) I found out that you can also change the provider order interactively, although it takes some digging to get into the Provider Order dialog in Windows.  To get to this dialog to to:

Network and Sharing Center | Adapter Settings | Tools Menu | Advanced | Advanced Settings | Provider Order

Yup it's buried. Here's what you get:

ProviderOrderDialog

After playing around with this it looks like this dialog also affects the registry settings and it did manage to remove my empty entries when I made a change. Note that you do have to make a change though for this to work.

Mysterious Settings

I hate shit like this! Clearly some application (which probably was uninstalled since) modified this setting, but nevertheless this is troublesome. Further the Windows 8 troubleshooting applet was a complete loss, going straight into 'Do you have permissions?' - of course not since I was never prompted :-) If you don't know what the problem it's hard to come up with the solution - I was lucky to find that forum post earlier that pointed me in the right direction. Hopefully this blog entry with a more explicit title will be a little easier to find.

Incidentally I think this has been a problem for a real long time of me being unable to map drives to servers - specifically my own Web Server. It hasn't been an issue since it's so rare that I ever need to do this, but yesterday we needed to quickly push some files up to a server that otherwise wasn't connected.

Hopefully this post will be useful to somebody who runs into the same problem.

Posted in Windows  

The Voices of Reason


 

Fico
April 05, 2013

# re: UNC Drive Mapping Failures: Network name cannot be found

Thank you, thank you, thank you. I was just about to install fresh windows since I could not connect to our network drive for the past two months.

Worked like a charm, I don't believe I ever found such a simple solution for something troubling me for weeks!

Again, thank you!

Richard
April 05, 2013

# re: UNC Drive Mapping Failures: Network name cannot be found

You can change the provider order through the UI - it's just not obvious. (At least, you can in Windows 7 or earlier; not sure about W8.)

You need to get to the Network Connections folder. In Vista / 7, you'll need to open the "Network and Sharing Center", and then click "Change adapter settings" in the left-hand panel.

Once you're in the right place, you'll need to view the menu. If you don't have it turned on, hit the "Alt" key. Then select "Advanced", "Advanced Settings..." to bring up the advanced settings dialog.

The first page will let you adjust the order of your network connections and choose which protocols are bound to which service. The second page will let you change the provider order.

wqw
April 05, 2013

# re: UNC Drive Mapping Failures: Network name cannot be found

Provider Order tab is completely missing if ProviderOrder value contains unrecognized providers. I found out I had webcliente listed there instead of WebClient. No idea what messed it up but the tab was completely gone.

This is on a Windows 8 box.

qaato
April 08, 2013

# re: UNC Drive Mapping Failures: Network name cannot be found


Wow, this has been a long-standing issue for me too, but could never find the problem. I looked at my registry entry for that key and found that LanmanWorkstation had been truncated somehow to LanmanWorks. Changing this got my ability to mount remote fileshares again!

Much appreciated!

Thomas
April 08, 2013

# re: UNC Drive Mapping Failures: Network name cannot be found

The webclient is needed to connect via webdav.

Ian G. Lloyd
April 10, 2013

# re: UNC Drive Mapping Failures: Network name cannot be found

in XP (for those still stuck in the early 00's like me) you can get to the interface via: Network Connections > Advanced > Advanced Settings > Provider Order... as always Rick thanx...

Marc
December 11, 2013

# re: UNC Drive Mapping Failures: Network name cannot be found

Thanks, Rick! Pure genious. After some corporate software updates, network sharing wasn't working at all. Checked the registry and LanmanWorkstation was missing completely (Win7). Added it and viola: I can access network shares again!

Struggler
September 21, 2014

# re: UNC Drive Mapping Failures: Network name cannot be found

Thanks alot.

I was abaout to throw my computer away and go buy an mac...

jtlodi
October 23, 2014

# re: UNC Drive Mapping Failures: Network name cannot be found

Wonderful Rick. Obviously you've more than VFP in your toolbox!
MadFox says "Hello"

rkm
September 22, 2015

# re: UNC Drive Mapping Failures: Network name cannot be found

Thank you so much, I had wasted so much time on this one.

In my case the offending app that messed with my provider order was: WebDrive, a tool used to map FTP/S3/etc drives as native Windows driver letters.

Locating the provider order was much easier in the past, can't understand why Microsoft is attempting to hide it these days.

For others that could not locate the provider order despite Rick's breadcrumb menu list, don't forget to use the "Alt" key when showing the list of network adapters. Pressing ALT on this window will show the menu bar, giving you the "Advanced" option.

Chris
October 28, 2015

# re: UNC Drive Mapping Failures: Network name cannot be found

Thanks,

I "upgraded" to windows 10 and had this exact issue, not sure why as initially it was working.

Saved me a headache.

Peter
January 23, 2016

# re: UNC Drive Mapping Failures: Network name cannot be found

I had the same problem with windows 10 after the upgrade. I changed the order of the providers to LanmanWorkstation,RDPNP,webclient as you did and it worked! Thank you very, very much!

AJ
March 22, 2016

# re: UNC Drive Mapping Failures: Network name cannot be found

I am getting same error but the difference is that I am trying to read this at runtime in a batch job. So my code logs in to the server with an id that's part of Local Logon group. It reads through all the shared folders (hundreds). I get "The Network name cannot be found." in about a 100 of the folders. Rest of them work as expected. Any clues as to why this subset of folders are failing?

Thank you,
AJ

RK
April 25, 2016

# re: UNC Drive Mapping Failures: Network name cannot be found

Worked- Great- Thanks

In my case, Unable to Map any Network drive or Communicate via Script. Even the Provider Tab was missing under advanced. System was infected with malware, but same issue even after cleanup. Populated the Registry keys for Network provider-RDPNP,LanmanWorkstation,webclient.Fixed.

Thanks
RK

Angel
September 19, 2017

# re: UNC Drive Mapping Failures: Network name cannot be found

I'm getting this only inside PowerShell.. I can see shares using Explorer as well as map network drives to those shares.. Attempting to run a script that previously ran fine on Windows 7 - generates Network name not found error. What is funny is that on my new Windows 10 box where I'm attempting to run the script from with elevated privileges, registry ProviderOrder on my workstation reads "LanmanWorkstation,RDPNP,webclient"... on the server, for grins I was curious as to what it's settings where and they are "SnacNp,RDPNP,LanmanWorkstation,webclient"... hmm.. so now I'm stumped because my registry settings appear to be correct, yet I'm still getting this error in PowerShell. Any updates on this issue for Windows 10 users?

 

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2017