Auto Reconnect Mapped Network Drive, Force Reconnect Windows 10 Shared Folders

Sharing is caring!

Auto reconnect mapped network drives on Windows 10 startup – A simple issue to fix but a nagging problem that occurs with many Microsoft Windows Operating Systems. I don’t know about you but I hate seeing that red X mark next to my shared folders especially when I know they are online. I can click on them and access them even though I am shown these red X marks on the share. My focus will be on non-domain joined computers but you may be able to apply these tips to domain computers as well. This article assumes that you have valid network credentials to connect to the shares, you have connected to these shares before and allowed Windows to save your password for these shares.

This problem mostly occurs on laptops because the WiFI connection (network adapter) takes some time to activate but we are logged into the system before a connection is established. This tells our Windows Operating system that the network resources are not available. It would have been helpful if Microsoft Windows initiated some re-checks on these folders after the network connection becomes active but it is what it is.

Auto Reconnect Mapped Network Drives

So how can I make sure that my mapped network shares automatically reconnect at logon? I am attaching a script that I’ve found online in this article that would accomplish just that. The initial script would error out if your laptop did not have a Wi-Fi connection or if it was set to Airplane mode so I have tweaked this script a bit. It should now automatically close if a mapped network drive connection cannot be made after Windows startup. If a connection can be made it would reconnect the shares and close out afterwards. You may add this batch file to run in your Windows startup folder or you may even get it to run in a domain environment using group policy. I have not personally tested this in a domain environment so if any one was successful running it please a leave a comment below.

Force Reconnect Windows 10 Shared Folders

Step 1 – Downloading & Editing the Batch File

Download the following script to your computer that needs the shared folders connected. Google Chrome typically downloads the file to your downloads folder, I believe Internet Explorer does as well.

Right click on the file and edit it in notepad to make your own unique changes. I personally use Notepad++ but notepad will work just fine. These changes would include your mapped drive letters, simply replace the drive letters in the script with your own. Please be sure to also point them to their actual locations on the network. Network paths should look something like this 

\\server\directory

.

Step 2 – Save & Copy Batch File To Windows Startup Folder

Once you have made the necessary changes to the file, It is now time to copy it to your Windows startup folder so that it will run the script automatically during startup.

If you are in notepad or notepad++ — go to file save as script.cmd or whatever you would like to call it, just make sure it has the extension .cmd.

Now press – Windows + R keys to run the command 

Shell:Startup

shell startup shortcut

This will open up the Microsoft Windows startup folder, now you can copy the script you have saved into this folder.

The file should now excute automatically during Windows bootup and automatically mount your mapped drives once a network connection is established. The script is set to close out itself if it was not able to establish a network connection or if the Wi-Fi connection is turned off.

I hope this article helped you out in someway, please let me know in the comments if did and please stick around for more useful posts. Thank You for visiting!

    1. SJ Jando July 7, 2022
      • Idle Eye'D July 7, 2022

    Add Your Comment

WD 6-TB Hard DriveOn Sale Now!

Save on Western Digital Red Drives, Perfect for NAS Devices or Servers.

shares