Link to home
Start Free TrialLog in
Avatar of Brian
BrianFlag for United States of America

asked on

Map Network Drive keeps disconnecting

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.
ASKER CERTIFIED SOLUTION
Avatar of John
John
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BigPapaGotti
BigPapaGotti

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.
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
Avatar of Brian

ASKER

Hi,

I'm not using WiFi at all. In fact I have WiFi disabled and only using NIC.
Avatar of Brian

ASKER

Will the script still work without using WiFi and if so can someone please help me. This is driving me crazy!!
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
Avatar of Brian

ASKER

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
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
Avatar of Brian

ASKER

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?
Avatar of Brian

ASKER

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?
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
Avatar of Brian

ASKER

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.
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
Avatar of Brian

ASKER

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?
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
Avatar of Brian

ASKER

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.
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
Avatar of Brian

ASKER

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

User generated image
... Thinkpads_User
Avatar of Brian

ASKER

Thank you for all your help with this post!!
@asp_net2 - You are most welcome and I was happy to help.

.... Thinkpads_User