If you have a home or work network set up for your Windows PC, you may also be mapping network shares to drive letters. Mapped drives are very convenient as they allow accessing network files and folders just like a regular local drive. However, in modern versions of Windows, there is a problem that mapped drives do not always automatically and reliably reconnect at logon. So any program that tries to access resources on the mapped network drive fails. Let us see how to fix this issue.
When you create a mapped network drive, there is an option 'Reconnect at logon' which you can check so that every time Windows logs on, they are automatically mounted using the current user's logon credentials. If you check 'Connect using different credentials', then you can specify a different user name and password.
When Windows logs on, there is a timing issue which causes it to attempt to map the network drives before the network is available. This results in them being unavailable sometimes. If you press Refresh in Windows Explorer or double click the drive, they instantly become available.
Zorn Software's MapDrive.exe to the rescue
This is nothing but a timing issue. Windows tries to map the network drives too early in the logon process and that is the reason they fail. A third party program called MapDrive.exe fixes this by repeatedly attempting to create the mapping until a specified timeout is reached. Because it uses repeated attempts, it is successful every time you log on.
- Download MapDrive from this page.
- Copy the EXE to some location in your system path. For example, C:\Windows
- Press the Win+R keys together on your keyboard and type: shell:startup. Press Enter. This will open your Startup folder.
- Right click in an empty area of File Explorer -> New -> Shortcut and create a shortcut with the following syntax:
<Path to MapDrive.exe> <DriveLetter> <\\ServerName\ShareName> <TimeoutInSeconds> [Username] [Password]
For example, if the drive letter you assigned is Z:, specify the following as the shortcut target:
C:\Windows\MapDrive.exe Z: \\Windows-PC\DriveZ 20
This will map the network share called 'DriveZ' on the remote computer named 'Windows-PC' to the drive letter Z: and will keep attempting to map it for 20 seconds.
- The user name and password are optional for MapDrive.exe's command line. You could also specify them while mapping them from Explorer and then only use the timeout in the shortcut.
This fixes the issue of network drives not reconnecting reliably at logon. You may still get the error message after you log on that it couldn't automatically reconnect but as startup items load, the error will go away when MapDrive.exe successfully reconnects to the share. If you are annoyed by this error message, you can hide it from Control Panel -> Notification Area Icons.
Making mapped drives available to programs that run as admin
In modern versions of Windows, the drives which you map are not available to programs that run as administrator because of the concept of split security token. So you must create the same shortcut to run as administrator at startup. Just use Winaero's ElevatedShortcut tool to create another shortcut in the startup folder as we previously showed. As long as this startup is placed in the Startup folder, the drives will be mapped for administrator level programs too.
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!