Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 10 / Slow Access to Shared Folders and Network Drives in Windows

March 11, 2024

Slow Access to Shared Folders and Network Drives in Windows

Our users are complaining about very slow network performance when opening or saving files to a network shared folder in Windows. When a user opens a shared folder via a UNC path, or via a drive letter (if the shared folder is mapped as a network drive), its contents are displayed only in 10-60 seconds. When creating new files in a network folder, they are also not displayed immediately, but with a long delay after 3-4 minutes (even if you update the folder contents with the F5 key). However, if you manually specify the full file name via a UNC path (\\lon-file-srv1\public\new_file.docx), it will open, although it won’t be visible in the File Explorer.

Slow access to network drive or folder from Windows

Windows uses a special Network Redirector component when access shared files and other network resources on remote computers. Starting with SMB v2.x (see the table with Server Message Block protocol versions), the Network Redirector uses a caching mechanism when accessing shared folders and files over the network. This reduces the traffic and the number of SMB requests between the client and the server (especially effective on in slow and unreliable networks). By default, this cache is cleared every 10 seconds.

If you are experiencing slow access to a network share on a Windows client device, you can try disabling the SMB metadata caching on the client side or in the shared folder settings.

You can disable SMB caching in the shared folder settings. Open the properties of the shared folder, and go to the Sharing tab -> Advanced Sharing -> Caching. Select the second option “No files or programs from the shared folder are available offline”.

disable network share caching in windows

Or use the PowerShell command from the built-in SMBShare module:

Set-SMBShare -Name MySharedDocs -CachingMode None

This will disable both caching and offline access to this shared folder (see the article on using offline files in Windows).

There are three registry parameters that manage network shared folder cache settings on the SMB client side. Microsoft states that the default values for these registry options provide the best performance for most environments. The SMB cache settings are located under the registry key HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters.

  • DirectoryCacheLifetime is the lifetime of the shared folder metadata cache (10 seconds by default);
  • FileNotFoundCacheLifetime – “File not found” response cache (5 seconds);
  • FileInfoCacheLifetime – the time of keeping the cache with the file info (10 seconds).
You can find information about these registry settings in the article on optimizing Windows file server settings: https://docs.microsoft.com/en-us/windows-server/administration/performance-tuning/role/file-server/

By default, the cache lifetime for an SMB share folder is only 10 seconds. When a client refresh the contents of a shared folder, the result of the last update is stored by the client for 10 seconds. When accessing this network share, all applications first try to use this cache.

In some cases, the mechanism for caching data in SMB folders doesn’t work correctly (most often this happens with network folders/drives containing thousands of files and folders). In this case, users may experience significant delays when opening, viewing, and creating files in shared folders.

You can disable caching for SMB folders. To do this, create a new DWORD parameter under the HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters registry key with the name DirectoryCacheLifetime and a value of 0. Also set the values of the FileInfoCacheLifetime and FileNotFoundCacheLifetime parameters to 0. You can create this registry parameters using regedit.exe or with the New-ItemProperty PowerShell cmdlet:

$regpath= "HKLM:\System\CurrentControlSet\Services\LanmanWorkstation\Parameters"
$Name1 = "DirectoryCacheLifetime"
$Name2 = "FileInfoCacheLifetime"
$Name3 = "FileNotFoundCacheLifetime"
New-ItemProperty -Path $regpath -Name DirectoryCacheLifetime -Value 0 -PropertyType DWORD -Force | Out-Null
New-ItemProperty -Path $regpath -Name FileInfoCacheLifetime -Value 0 -PropertyType DWORD -Force | Out-Null
New-ItemProperty -Path $regpath -Name FileNotFoundCacheLifetime -Value 0 -PropertyType DWORD -Force | Out-Null

DirectoryCacheLifetime registry parameter can fix slow access to files on shared folders

You must restart your computer for the settings to take effect. If these parameters need to be applied to multiple domain computers, you can use the GPO to deploy the registry settings.

Disabling network folder caching increases network traffic and reduces file-server performance.

You can also use the Set-SmbClientConfiguration cmdlet to fine-tune the SMB client:

Set-SmbClientConfiguration -DirectoryCacheLifetime 0
Set-SmbClientConfiguration -FileInfoCacheLifetime 0
Set-SmbClientConfiguration -FileNotFoundCacheLifetime 0

You can list the current caching settings for the Windows SMB client with PowerShell:

Get-SmbClientConfiguration| select *cache*

DirectoryCacheEntriesMax : 16
DirectoryCacheEntrySizeMax : 65536
DirectoryCacheLifetime : 0
FileInfoCacheEntriesMax : 64
FileInfoCacheLifetime : 0
FileNotFoundCacheEntriesMax : 128
FileNotFoundCacheLifetime : 0

powershell get-smbclientconfiguration cachelifetime

After that, all changes in the shared will be immediately displayed on the client (the contents of the folder are refreshed each time it is accessed and the local cache is not used).

There are several other reasons for poor network performance of shared folders, or when the contents of folders may appear slowly:

  • Enabling the “Access-based Enumeration (ABE)” option in the shared folder settings can lead to a slow update of the list of files in a shared folder with a large number of objects;
  • You may experience slow network speed on Hyper-V virtual machines running on Windows Server 2019 (compared to Windows Server 2016/2012R2);
  • Try to disable the legacy NetBIOS protocol in the properties of your TCP/IPv4 connection on the domain-joined devices (ncpa.cpl -> open the network adapter’s TCP/IPv4 settings and select Disable NetBIOS over TCPIP on the WINS tab);
  • Try resetting the network and TCP/IP stack settings on the Windows client device. On Windows 10+, you can use the Network Reset option in the Settings panel or use the command: netsh int ip reset
2 comments
14
Facebook Twitter Google + Pinterest
PowerShellWindows 10Windows Server 2019
previous post
Search and Delete Emails from User Mailboxes on Exchange Server (Microsoft 365) with PowerShell
next post
How to Upgrade VM Hardware Version in VMware ESXi

Related Reading

How to Repair EFI/GPT Bootloader on Windows 10...

March 16, 2024

How to Restore Deleted EFI System Partition in...

March 11, 2024

Wi-Fi (Internet) Disconnects After Sleep or Hibernation on...

March 15, 2024

How to Repair Windows Boot Manager, BCD and...

March 11, 2024

Fix: The Computer Restarted Unexpectedly or Encountered an...

May 16, 2024

PowerShell: Get Folder Size on Windows

April 2, 2024

Network Computers are not Showing Up in Windows...

March 15, 2024

How to Download Offline Installer (APPX/MSIX) for Microsoft...

March 12, 2024

2 comments

Anonymous May 18, 2022 - 1:45 pm

Mir ist grade aufgefallen, dass es zu Beginn für 10-30 Sekunden schnell lädt (300-1000 mbit/s) und es danach dann runtergeht, auf paar kb/s, mit 10 Sekundenpausen zwischen den Pieks.

Der Kundenrechner ist in einer Domain und ich kann da nicht alles ausprobieren.

Set-SmbClientConfiguration -DirectoryCacheLifetime 0
Set-SmbClientConfiguration -FileInfoCacheLifetime 0
Set-SmbClientConfiguration -FileNotFoundCacheLifetime 0
Get-SmbClientConfiguration | Select *cache*
hat jedenfalls nichts geholfen (immer wieder witzig, dass man durch Abschalten eines Cache, der es ja eigentlich schneller machen soll, etwas schneller macht, anstatt langsamer … da hat jemand beim Delphi-Compiler abgeguckt )

[…] -FileNotFoundCacheLifetime 0 Get-SmbClientConfiguration| select *cache* von hat jedenfalls nichts geholfen (immer wieder witzig, dass man durch Abschalten eines Cache, der es […]https://www.delphipraxis.net/210601-start-von-share-ploetzlich-extrem-langsam-2.html#post1506023

Reply
John Baker March 28, 2025 - 8:59 pm

I might be wrong but I have a suspicion this sometimes happens because Windows tries to log in with your current account first and retries or something but there’s a big timeout to prevent brute force. Perhaps cycling through authentication methods. Only when it gives up and the last timeout elapses does the password prompt for you to manually do it come up. Perhaps there are some settings somewhere so as to not do this and instead immediately try to manually log in or something.

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Encrypt Any Client-Server App Traffic on Windows with Stunnel

    June 12, 2025
  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025
  • Disable the Lock Screen Widgets in Windows 11

    May 26, 2025
  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Install and Manage Windows Updates with PowerShell (PSWindowsUpdate)
  • How to Download Offline Installer (APPX/MSIX) for Microsoft Store App
  • How to Delete Old User Profiles in Windows
  • Fix: Remote Desktop Licensing Mode is not Configured
  • How to Install Remote Server Administration Tools (RSAT) on Windows
  • Configuring Port Forwarding in Windows
  • Start Menu or Taskbar Search Not Working in Windows 10/11
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top