TechBuzzPro

Clear Mapped Network Drive Cache in Windows 10

· 6 min read · Wi-Fi & Networking

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To clear the mapped network drive cache in Windows 10, you need to delete the stored credentials and refresh the drive connection. This resolves issues like stale file listings, "access denied" errors, or the drive showing as disconnected even though the network share is reachable. The simplest method is to remove the mapped drive, clear the credential cache, and remap it. No additional tools are needed—everything is built into Windows.

What You'll Need

  • Administrator access to your Windows 10 PC (to run Command Prompt as admin).
  • The network path (UNC) of the mapped drive, e.g., \\server\share.
  • Credentials for the network share (username and password) if it's not open to everyone.

Step-by-Step

  1. Close any open files or folders that are using the mapped drive. If a program is reading from or writing to the drive, the cache may be locked, and the steps below could fail.
  2. Disconnect the mapped drive via File Explorer. Open File Explorer, right-click the mapped drive under "This PC", and select "Disconnect". If you prefer, you can use the command line: open Command Prompt (not as admin) and type net use Z: /delete (replace Z: with the actual drive letter). Press Enter.
  3. Clear the stored credentials in Windows Credential Manager. Press Win + R, type control /name Microsoft.CredentialManager, and press Enter. Click "Windows Credentials". Look for entries under "Generic Credentials" that match your network path (e.g., \\server\share or server). Click the arrow next to the entry, then click "Remove". Confirm when prompted. Repeat for any other entries related to the same server.
  4. Clear the credential cache via Command Prompt (optional but thorough). Right-click the Start button and select "Command Prompt (Admin)" or "Windows PowerShell (Admin)". Type cmdkey /list and press Enter to see all stored credentials. To delete a specific one, type cmdkey /delete:targetname (replace targetname with the exact target name shown in the list). For example, cmdkey /delete:\\server\share. Press Enter. To delete all cached credentials (not just network ones), type cmdkey /deleteall—but be aware this removes all saved passwords, including for websites and apps.
  5. Restart the Workstation service (optional). This clears the local network session cache. In the same admin Command Prompt, type net stop workstation and press Enter, then type net start workstation and press Enter. This will briefly disconnect all network shares, so make sure no files are open.
  6. Remap the network drive. Open File Explorer, right-click "This PC" in the left pane, and select "Map network drive". Choose a drive letter, enter the network path (e.g., \\server\share), check "Reconnect at sign-in" if you want it persistent, and check "Connect using different credentials" if you need to enter a specific username/password. Click "Finish". Enter the credentials when prompted and check "Remember my credentials" if you want them saved.
  7. Test the drive. Open the mapped drive and navigate to a folder to confirm the file listing is fresh. If you still see old files, try pressing F5 to refresh, or wait a few seconds and reopen.

Common Mistakes

  • Not clearing credentials: Simply disconnecting and remapping without clearing the credential cache often doesn't fix the issue, because Windows keeps using the cached credentials and the old connection state.
  • Using the wrong target name in cmdkey: If you type the target name incorrectly, the credential won't be deleted. Always copy the exact target name from cmdkey /list output.
  • Forgetting to close open files: If a file is open on the mapped drive, the disconnect step may fail with a "This network connection is in use" error.
  • Running Command Prompt without admin rights: Some steps (like stopping the Workstation service) require admin rights. If you get "Access denied", close and reopen the Command Prompt as administrator.
  • Deleting all credentials when not needed: cmdkey /deleteall removes every saved password, including for web sites and apps, which can be a hassle to re-enter.

Tips

  • Use the same drive letter when remapping to avoid confusion with shortcuts or scripts that reference the old letter.
  • Check the network share's permissions if you still get "Access denied" after clearing the cache—the issue may be on the server side, not your PC.
  • If the drive is set to "Reconnect at sign-in", sometimes Windows fails to reconnect it at boot. After clearing the cache, remap it with that checkbox checked, and it should reconnect automatically.
  • Use the "net use" command to see current connections before and after to verify the drive is disconnected and then remapped correctly.
  • If you use a VPN, disconnect and reconnect the VPN after clearing the cache, as the network path may resolve differently.

Troubleshooting

If the drive still shows stale content or errors after following the steps:

  1. Check if the server is reachable. Open Command Prompt and type ping \\server (or ping server). If it fails, the server may be offline, or your network connection is down.
  2. Verify the share path. In File Explorer, type the UNC path directly (e.g., \\server\share) in the address bar. If you can access it directly but the mapped drive fails, the mapping is the problem—repeat the steps and ensure you clear the specific credential.
  3. Check for Group Policy settings. If your organization enforces a policy that remaps drives at logon, your manual mapping may be overridden. In that case, contact your IT admin.
  4. Try a different drive letter. Sometimes a drive letter is reserved or conflicts with a local drive. Use a letter that is not in use.
  5. Restart your PC. A full restart clears all network sessions and often resolves stubborn cache issues.
  6. If the drive disconnects repeatedly, it may be due to the server's idle timeout. Change the drive's "Idle session timeout" on the server side, or use a script to keep the connection alive.

Frequently Asked Questions

Will clearing the cache affect my files on the network share?

No, clearing the cache only removes local cached information about the connection and credentials. Your files remain untouched on the server.

Do I need to be an administrator to clear the cache?

You can disconnect and remap a drive as a regular user, but clearing the credential cache via cmdkey or stopping the Workstation service requires admin rights.

What if I don't know the exact network path?

You can find it by opening the mapped drive's properties (right-click > Properties) and looking at the "Target" or "UNC Path" field. Alternatively, use net use in Command Prompt to list all current mappings.

Why does the mapped drive show as disconnected even though I can access the server directly?

This often happens when Windows has cached a stale session. Clearing the cache and remapping usually fixes it. If not, check the server's share permissions or firewall settings.

Can I clear the cache for only one drive without affecting others?

Yes, you can delete only the specific credential for that drive using cmdkey /delete:targetname. Other mapped drives will keep their cached credentials.

Will this fix slow loading times for mapped drives?

Yes, clearing the cache can speed up loading if the cache is corrupted or outdated. However, if the slowness is due to network latency or server performance, clearing the cache won't help.