Can't Access Mapped Drives in Windows 7 following VPN Disconnect

I'm running Windows 7 Pro 64-bit in a single-server Windows 2003 AD environment and have an annoying drive-mapping problem.  I have three drives mapped to the server by name, e.g. \\server\folder.  I often have to VPN into another network via PPTP, and about 50% of the time following diconnecting properly from the VPN, I can no longer access my mapped drives.  I get the error. "G:\ is not accessible.  An unexpected network error occurred."

If I go to the Run line and type \\server\folder, I can connect fine, though I still can't access the folder by drive letter.  If I disconnect the mapped drive and attempt to remap it, it fails with the "An unexpected network error occurred" message, even if I have the folder open from the run line.

There are no errors in the PC or server Event Viewer that I can find.  The only fix I have is to either log off and back on, reboot, or -- and perhaps this is a clue -- remap the drives by IP address, e.g. \\\folder.  Because the latter is a workaround, this is not an overly pressing issue, however, I would like to get it resolved.

Thanks in advance.
Who is Participating?
Ernie BeekConnect With a Mentor ExpertCommented:
Just a wild thought here: what if you use the FQDN for the server when setting up the mappings?
Ernie BeekExpertCommented:
It looks there is some issue with DNS or wins. Is the PPTP connection also getting dns/wins settings when dialing in?
Don ThomsonCommented:
I had a similar problem - The workstations required a reboot every morning to get the server drives mapped back in.

In the end it turned out that the power down to save energy on the server Nic was turned on - Every time it turned off - the workstation lost the trust of the server. Both ends should have that feature turned off.

You may also want to try doing the following - open a cmd prompt

net use x: /DELETE
net use x: \\server\folder /PERSISTENT:YES

If that works and you get the drive connection back then try your VPN connection - Disconnect and see if the drive is still accessible. If it isn't then create a batch file deleting then creating your drives

If that works you may be able to modify the batch file to include the VPN command in the first line - with some kind of a loop to recognize when the program is terminated then do your reconnections

Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

Try this on your VPN connection

At the connect to windows click properties.
Choose the Networking Tab and then highlight Internet Protocol (TCP/IP) and click properties.
Next click Advanced.
And now de-select “Use default gateway on remote network”.

GreenLeafProsAuthor Commented:
erniebeek: PC is getting DNS through the VPN connection.  I was thinking the same thing as you, that I wasn't getting my DNS back properly after a disconnect.  However, that wouldn't explain the fact that I can type the path in at the Run line and connect with no problem.

DTHConsulting: I don't think this is a NIC issue because A) I never had the problem in the past with Vista (believe it or not), B) this issue can happen after being VPN'ed in for 30 seconds and C) I can still connect fine through other means.

Your idea of remapping using NET USE seems to work.  While this may be a workaround -- and I'll use it for now -- it still doesn't fix the actual problem.  While I can embrace the batch file, it should not be required.

And a new wrinkle... If my G: drive is mapped and then fails, I can disconnect the G: drive through the drive mapping GUI, but am unable to remap it by name.  HOWEVER, I can map it by name fine to an unused drive letter.
GreenLeafProsAuthor Commented:
mattclarified: Unchecking "Use default gateway on remote network" causes too many other issues.  When I do that, I can no longer ping objects on the remote network by name.  Also, the remote network is connected by a branch office VPN to another network, and I can't reach machines on that network at all, even by IP.
Don ThomsonCommented:
If you have used the NET USE  command using /persistent:yes
and you disconnect using the Gui - Then that drive will not really be available to be remapped until you use the NET USE g: /delete   if I'm not mistaken
GreenLeafProsAuthor Commented:
First, thanks for all the input.  It's appreciated.  Because this problem is more on the random side, I'll need some time to test the various ideas.  What I've done is:

Mapped drive X: through the GUI to \\server\folder1
Mapped drive Y: through the GUI to \\server.domain.local\folder2
Mapped drive Z: using NET USE  Z: \\server\folder3 /PERSISTENT:YES

I'm typically in and out of the VPN on a daily basis.  I'll get back to eveyone by Monday or as soon as I see a result one way or another.
If you have to use the VPN on a regular basis, I would recommend installing Microsoft Virtual PC or VMWare to create a virtual PC to use for the VPN use.  You can use the virtual PC for the VPN tasks and not need to worry about disconnecting from the network drives.
GreenLeafProsAuthor Commented:
Unfortunately, I've been out of the office a lot and haven't been able to do too much testing.  I'll try some more in the morning and get back to you.

Have you tried mapping your drives by IP address rather than server name?  This might work as a quick fix to the problem.

GreenLeafProsAuthor Commented:
OK, the results are in for now.  I haven't been able to recreate the problem exactly, but I can tell you the following:

After rebooting my machine at some point, the drive I mapped using NET USE no longer worked.  The mapping was there, but it gave me a credentials error for some reason, and I had to remap it.  I'd only ever been logged in with one account.

While VPNed in at one point, I went to my drive mappings and seriously watched them all, one at a time, disappear -- except for the drive mapped with the FQDN, which worked fine.  Incidentally, the ones that disappeared had red X's before doing so, and after I ended my VPN session, they all returned and worked.

So, even though I'm not 100% sure this is fixed, I can say that in the past I could never access my local drives by name (using Win 7) while VPNed in until I used the FQDN mapping, so I feel the need to award my points to erniebeek, as this seems to be the best solution.

And lastly, to mattclarified, using the IP address has always worked, as I believe I mentioned in my original post.  The goal was to get the mappings to work by name following a VPN connection, which had always worked in XP and Vista in this environment, but which were not working ionsistently with WIn7.

Thanks to all for your input.  It has been greatly appreciated.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.