Windows 11 Mapped Drive Disconnects After Sleep: Fix
🔍 WiseChecker

Windows 11 Mapped Drive Disconnects After Sleep: Fix

Your Windows 11 mapped network drives disappear or show a red X after the computer wakes from sleep. This happens because Windows 11 disconnects network sessions during sleep to conserve power. When the PC wakes, the drive mapping fails to reconnect automatically. This article explains why the disconnection occurs and provides three reliable fixes to keep your mapped drives connected after sleep.

Key Takeaways: Preventing Mapped Drive Disconnects on Sleep

  • Power Options > Change plan settings > Change advanced power settings > Hard disk > Turn off hard disk after: Set to 0 (Never) to prevent the network adapter from dropping the drive connection during sleep.
  • Command Prompt (Admin) > net config server /autodisconnect:-1: Disables the automatic disconnection of idle network sessions, keeping mapped drives alive.
  • Scheduled Task with reconnect script: Runs a net use command at wake-up to re-map the drive if the connection drops.

ADVERTISEMENT

Why Mapped Drives Disconnect After Sleep in Windows 11

Windows 11 manages network connections through the Network Session Manager. When the computer enters sleep, the operating system suspends all active network sessions to reduce power consumption. The network adapter may also be powered down, depending on your power plan settings. When the PC wakes, Windows 11 attempts to restore network connectivity, but the mapped drive session may not automatically re-establish. This is especially common with drives mapped to file servers using drive letters via the net use command or File Explorer.

The root cause is the default power plan setting for the hard disk and network adapter. By default, Windows 11 turns off the hard disk after 20 minutes of inactivity. If your mapped drive is on a network share, the local hard disk power setting does not directly affect it. However, the network adapter may enter a low-power state, and the server-side session timeout may expire during sleep. The Server Message Block protocol has a built-in auto-disconnect feature that ends idle sessions after 15 minutes by default. If your computer sleeps longer than 15 minutes, the server disconnects the session, and Windows 11 does not automatically reconnect the drive letter.

Fix Mapped Drive Disconnects After Sleep in Windows 11

There are three effective methods to prevent mapped drives from disconnecting after sleep. Try them in order. The first method modifies power settings. The second method disables the auto-disconnect timer. The third method creates a scheduled task to reconnect drives on wake.

Method 1: Disable Hard Disk Sleep and Network Adapter Power Saving

  1. Open Power Options
    Press Windows + R, type powercfg.cpl, and press Enter.
  2. Select your active power plan
    Click Change plan settings next to the plan currently selected, such as Balanced or High performance.
  3. Open advanced power settings
    Click Change advanced power settings.
  4. Disable hard disk turn-off
    Expand Hard disk, then expand Turn off hard disk after. Set both On battery and Plugged in to 0 (Never). Click Apply.
  5. Disable network adapter power saving
    Expand Wireless Adapter Settings or PCI Express depending on your adapter type. Expand Power Saving Mode and set both values to Maximum Performance. Click Apply and then OK.
  6. Disable network adapter power management in Device Manager
    Press Windows + X and select Device Manager. Expand Network adapters, right-click your active network adapter, and select Properties. Go to the Power Management tab. Uncheck Allow the computer to turn off this device to save power. Click OK.

Method 2: Disable the Server Auto-Disconnect Timer

  1. Open Command Prompt as Administrator
    Press Windows + S, type cmd, right-click Command Prompt, and select Run as administrator. Click Yes in the User Account Control prompt.
  2. Check current auto-disconnect value
    Type the following command and press Enter:
    net config server
    Look for the line that says The autodisconnect time is (in minutes): 15.
  3. Disable auto-disconnect
    Type the following command and press Enter:
    net config server /autodisconnect:-1
    This disables the automatic disconnection of idle sessions.
  4. Verify the change
    Type net config server again. The autodisconnect time should now show -1.

Method 3: Create a Scheduled Task to Reconnect Drives on Wake

  1. Open Task Scheduler
    Press Windows + S, type Task Scheduler, and open the app.
  2. Create a new task
    In the right-hand Actions pane, click Create Task.
  3. Name the task
    In the General tab, type Reconnect Mapped Drives. Check Run with highest privileges. Check Run whether user is logged on or not.
  4. Set the trigger
    Go to the Triggers tab and click New. Set Begin the task to On an event. Set Log to System. Set Source to Power-Troubleshooter. Set Event ID to 1. Click OK. This triggers the task when the system wakes from sleep.
  5. Set the action
    Go to the Actions tab and click New. Set Action to Start a program. In Program/script, type powershell.exe. In Add arguments (optional), paste the following script:
    -Command "Get-SmbMapping | ForEach-Object { if ($_.Status -eq 'Disconnected') { net use $_.LocalPath $_.RemotePath /persistent:yes } }"
    Click OK.
  6. Configure conditions
    Go to the Conditions tab. Uncheck Start the task only if the computer is on AC power. Uncheck Stop if the computer switches to battery power. Click OK.
  7. Enter your password
    When prompted, enter your Windows account password. The task will now run each time the computer wakes from sleep.

ADVERTISEMENT

If Mapped Drives Still Disconnect After Sleep

Mapped drive shows disconnected after waking but other network resources work

This indicates the server session expired during sleep. Method 2 above is the most direct fix. If the server is not your own Windows machine, you cannot change the server’s auto-disconnect setting. In that case, use Method 3 to automatically reconnect on wake.

Mapped drive reconnects but takes several minutes

Slow reconnection often results from the network adapter taking time to re-establish a link. In Device Manager, open your network adapter’s Properties, go to the Advanced tab, and set Wake on Magic Packet and Wake on Pattern Match to Enabled. This keeps the adapter in a low-power state that can respond to network traffic sooner.

Mapped drive disconnects even when the computer does not sleep

If the drive disconnects during active use, the issue may be a network driver problem or a faulty cable. Update your network adapter driver from the manufacturer’s website. Also check the server’s event logs for SMB disconnection events.

Power Settings vs. Auto-Disconnect vs. Scheduled Task: Comparison

Item Power Settings Auto-Disconnect Timer Scheduled Task
Scope Local PC only Local PC only Local PC only
Requires admin rights Yes Yes Yes
Affects all network sessions No Yes No
Works after server-side timeout No No Yes
Permanent fix Yes Yes Yes

You can now prevent mapped drives from disconnecting after sleep by adjusting power settings, disabling the server auto-disconnect timer, or creating a scheduled task. Start with Method 1 because it addresses the most common cause. If the problem persists, apply Method 2. For drives mapped to a server you do not control, use Method 3. As an advanced tip, combine Method 1 and Method 3 for the most reliable results across different network environments.

ADVERTISEMENT