TECH / Windows 4 min read

Network Drives Show in net use but Not in File Explorer – How to Fix

Antonio NEMCD Author
Published Aug 19, 2022 · 4 min

On some computers with Windows 7 and Windows 10, after network drives are mapped (by Group Policy or a script), the drives are not shown in File Explorer. If you try to map a drive manually, it fails: the drive letter is already in use. For a while I was puzzled by this problem – it happened rarely – but one day I decided to get to the bottom of it.

Mapping a network drive in Windows

In short: if net use in the command prompt shows the drives but File Explorer does not, there are usually two reasons. Either the drives are mapped before the network has started – the “Always wait for the network at computer startup and logon” policy helps. Or a script mapped the drives as administrator, while File Explorer runs without elevated rights and cannot see them.

How to find the cause

Open a regular command prompt (not as administrator) and run:

net use
  • The drives are in the list but not in File Explorer – most likely the network was not up yet when the drives were mapped. See method 1 or 2.
  • The drives are missing in the regular console but present in the administrator one – they were mapped in the “admin” session. See method 3.

A quick way to test the guess is to disconnect the drive and map it again (replace Z: and \\server\share with your own):

net use Z: /delete
net use Z: \\server\share

If the drive then appears in File Explorer, the problem is the mapping time.

Method 1: wait for the network at logon

The fix turned out to be simple: you need to enable a special option in the Local Group Policy Editor.

  1. Press Win+R, type gpedit.msc and press Enter.
  2. Go to Computer Configuration → Administrative Templates → System → Logon.
  3. Enable Always wait for the network at computer startup and logon, as in the screenshot.

The Always wait for the network at computer startup and logon setting in gpedit.msc

Restart the computer and check. The screenshot shows the Russian version of Windows; the setting is in the same place in the English one. In a domain it is more convenient to enable it in Group Policy for all computers at once. Windows Home does not have gpedit.msc – method 2 helps there.

The method has only one downside: logon may take a few seconds longer.

Method 2: a delay before mapping in the script

If the drives are mapped by your own script, you can add a delay before mapping – during this time all the required services will start, and the drives will be mapped normally:

ping -n 11 127.0.0.1 >nul
net use Z: \\server\share

ping -n 11 gives a pause of about 10 seconds. The timeout 10 command does the same in a regular console, but in scripts that run without a window (logon scripts, for example) it often exits immediately with the error “Input redirection is not supported”, so ping is more reliable.

Method 3: the script runs as administrator

A reader gave the hint: the drive mapping script must be run as the current user, not as administrator. When User Account Control (UAC) is on, an administrator gets two sessions at logon – a regular one and an elevated one. A mapped network drive is visible only in the session where it was mapped. That is why a drive mapped by a script “as administrator” shows up in net use in the admin console but is missing from File Explorer.

The best way is to run the drive mapping script without elevation. If that is inconvenient, you can make Windows show the drives in both sessions. Open the command prompt as administrator and run:

set K=HKLM\SOFTWARE\Microsoft\Windows
set K=%K%\CurrentVersion\Policies\System
reg add "%K%" /v EnableLinkedConnections ^
  /t REG_DWORD /d 1 /f

Then restart the computer. Keep in mind: according to Microsoft’s documentation, this setting does not help if the UAC policy for administrators is set to prompt for credentials (rather than for consent) – in that case elevation creates a completely new session.

Summary

  • First, look at net use in the regular and in the admin console.
  • The drives are mapped too early – enable waiting for the network or add a delay to the script.
  • The drives are mapped “as administrator” – run the script as the user or enable EnableLinkedConnections.

A similar problem with network folders: Excel files are not saved to a network drive.

Related posts:

Leave a Comment