[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6882
  • Last Modified:

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.
0
asp_net2
Asked:
asp_net2
  • 10
  • 10
1 Solution
 
John HurstBusiness Consultant (Owner)Commented:
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
 
BigPapaGottiCommented:
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
 
John HurstBusiness Consultant (Owner)Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
asp_net2Author Commented:
Hi,

I'm not using WiFi at all. In fact I have WiFi disabled and only using NIC.
0
 
asp_net2Author Commented:
Will the script still work without using WiFi and if so can someone please help me. This is driving me crazy!!
0
 
John HurstBusiness Consultant (Owner)Commented:
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
 
asp_net2Author Commented:
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
 
John HurstBusiness Consultant (Owner)Commented:
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
 
asp_net2Author Commented:
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
 
asp_net2Author Commented:
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
 
John HurstBusiness Consultant (Owner)Commented:
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
 
asp_net2Author Commented:
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
 
John HurstBusiness Consultant (Owner)Commented:
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
 
asp_net2Author Commented:
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
 
John HurstBusiness Consultant (Owner)Commented:
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
 
asp_net2Author Commented:
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
 
John HurstBusiness Consultant (Owner)Commented:
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
 
asp_net2Author Commented:
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
 
John HurstBusiness Consultant (Owner)Commented:
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
 
asp_net2Author Commented:
Thank you for all your help with this post!!
0
 
John HurstBusiness Consultant (Owner)Commented:
@asp_net2 - You are most welcome and I was happy to help.

.... Thinkpads_User
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 10
  • 10
Tackle projects and never again get stuck behind a technical roadblock.
Join Now