Solved

Map Network Drive keeps disconnecting

Posted on 2014-01-21
21
5,752 Views
Last Modified: 2014-01-22
Hello Experts,

I have a laptop running Windows 7 Professional SP1. I have two mapped network drives and when I restart my laptop the network drives do not reconnect. Also, if the laptop is inactive for sometime I have noticed that the map network drives will drop. They reconnect if I were to double click on each of them, but I would like to them just connect once the laptop turns on and not disconnect if the laptop is idle.
0
Comment
Question by:asp_net2
  • 10
  • 10
21 Comments
 
LVL 92

Accepted Solution

by:
John Hurst earned 500 total points
ID: 39798865
For each drive, run:

NET USE X: /Delete  (where X is the drive).  Repeat for each drive.

Now run NET USE to see if any entries remain in the list.

Then run NET USE /PERSISTENT:NO

Then restart the computer and re-map the drives.  Do they now stay connected?

.... Thinkpads_User
0
 
LVL 9

Expert Comment

by:BigPapaGotti
ID: 39798881
I think what is happening is that the drives try to map before the wireless network is connected. What I would try to do is create a script that will pause for about 30 seconds and then map the network drives. You can place this script in your startup folder so it runs every time your. Computer starts.
 To create the script open notepad and type in the following where x and w are your network drive letters you want to have save this file with a .bat file extension and test to ensure it works properly:

timeout /t 30 /nobreak > NUL
Net use x: \\server name\sharename
Net use w: \\server name\sharename

As for your computer going idle is the pc going to sleep or not. I would check the power options in control panel to see if the wifi card is being deactivated after a certain amount of time.
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 39798887
Wireless needs to connect before server operations.

What I do is use a script file on the user's Desktop to map drives after the connection is made.

Still go through my post above to remove phantom maps no longer used.

.... Thinkpads_User
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39798892
Hi,

I'm not using WiFi at all. In fact I have WiFi disabled and only using NIC.
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39798894
Will the script still work without using WiFi and if so can someone please help me. This is driving me crazy!!
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 39798899
Yes a script will work wired or wireless.

Check persistence first as I suggested and let us know about that.

If you wish to use a script, set up a batch file on the desktop with NET USE commands in it to map drives and folders.

... Thinkpads_User
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39798934
thinkpads_user,

Ok, so I used notepad and added the following lines below but I changed my server name to map to my location and saved it as a .bat file. What do I need to do now with that .bat file in order for the network shares to run?

timeout /t 30 /nobreak > NUL
Net use x: \\server name\sharename
Net use w: \\server name\sharename
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 39798939
Copy the .bat file to the desktop and call it "Connect to server" . Once copied, double click it to run it.

I really wish you would go back to my first post and check persistence. Since you have a wired connection, that may well be the issue.

... Thinkpads_User
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39798947
Hi thinkpads_user,

I will check the persistence now. I just re-created the map network drives. Do I now just run what you supplied for the persistence check?
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39798973
Hi thinkpads_user,

The first method that you supplied did indeed work. Now when I restart or shutdown the laptop the map network drives DO NOT disconnect now. Now, do I need to worry about the laptop being on for so long before it stops working?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 92

Expert Comment

by:John Hurst
ID: 39799569
If you shut down the laptop in an orderly manner each time, it should remember its mappings and you should be fine.

If disconnections are random (disconnect the cable, shut down later), then I always use a disconnect script.

Net use x: /Delete
Net use w: /Delete

Make a .bat file, copy it to the desktop and call it "Disconnect Server"

You can also do this:

Delete network drives as before.

Now map drives (folders) via Windows Explorer. In the Map session, uncheck the setting that says "Remember network connection" (something like that). With that unchecked, network drives should not be remembered when you shut down.

.... Thinkpads_User
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39799824
Hi thinkpads_user,

 >> If disconnections are random (disconnect the cable, shut down later), then I always use a disconnect script.

Not sure what you mean by the above statement.

>> Make a .bat file, copy it to the desktop and call it "Disconnect Server"

So if I were to keep experiencing disconnects then I should create a .bat file with the following code snippet above? Also, do I need to include that .bat file within startup and if so which is the best way to do that?

I must have shutdown and restarted the laptop at least 7 times and it never dropped the network shares so hopefully it's fine now thanks to you.
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 39799842
If you have a laptop on Ethernet with open files / shares and then unplug Ethernet to move the machine to another desk / room, you will have to reconnect. At that point, it is possible to get a new drive letter (not always, just possible) and then you have the problems you had.

Now removing persistent drives and clearing up the problem is likely to be fine for a long while. It could happen again. Persistent drives are common, they work, but they screw up too.

... Thinkpads_User
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39799847
Ok, so is there a solution that I could implement if need be that would always map the network drives all the time using the same map network drive letter?
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 39799860
I service different clients, so I have Connect scripts (as above) and Disconnect scripts (as above). I connect Z:  (say) and then disconnect Z: when complete. I never have random disconnections and I have been using the same scripts for years (different machines and operating systems).

... Thinkpads_User
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39799883
Ok, could I have just one .bat script run with the disconnect and reconnects if I were to experience more issues with this in the future or would I need to different .bat scripts one for disconnect and one for reconnect?

The drive letters that I would always need are G: and Z: Would you be able to supply me with what I would need for the disconnect and reconnect for one .bat file or the two separate .bat files if I would need them? I'm not good at all witih .bat files so just want to make sure I would be doing it write.
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 39799905
As per above posts, for a connect script, use:

Net use x: \\server name\sharename
Net use w: \\server name\sharename

Select the Drive letters and shares you need. Enter the scripts in connect.bat and copy it to the desktop.

As per above posts, for a disconnect script, use:

Net use x: /Delete
Net use w: /Delete

Select the SAME drive letters as above. Enter the scripts in disconnect.bat and copy it to the desktop.

Restart and test the scripts.

As I noted above, persistent drives are common and generally work. You do NOT have to use scripts at all.

If your server scripts the connect, then just set the map to be non-persistent in Windows Explorer Map Network Drive.

There is more than one way to do all this.

.... Thinkpads_User
0
 
LVL 4

Author Comment

by:asp_net2
ID: 39799932
Ok, last question. I was not sure what you meant by the following below. How would I do that and when would I do that if need be?

>> If your server scripts the connect, then just set the map to be non-persistent in Windows Explorer Map Network Drive.
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 39799957
In your operating system, find Windows Explorer, open it and then find Map Network Drive.  For each Drive mapping, set as below. Once set, the drives should be non-persistent and it only needs to be set once.

Windows-8-Map-Network-Drive-Settings
... Thinkpads_User
0
 
LVL 4

Author Closing Comment

by:asp_net2
ID: 39799964
Thank you for all your help with this post!!
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 39799982
@asp_net2 - You are most welcome and I was happy to help.

.... Thinkpads_User
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

I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

867 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

24 Experts available now in Live!

Get 1:1 Help Now