Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

Slow Access to Network Shares on Windows Computers

/
/
Windows 10 logo


In 2017, I wrote an article What to Do When Creating Folders or Accessing Files on Remote Computer is Very Slow. In 2018, I wrote another article titled How to Fix Slow Access to Network Shares. Because the information addressed the same topic, but was published in two different articles, I decided to combine the content of both the articles into this post for readers’ convenience.


I was experiencing an issue on my network that was bugging me for some time. I would spend about 30-60 minutes here and there to try to resolve the problem but couldn’t dedicate enough time to fix my issue. In this article, I am going to describe my scenario, then share the different techniques I used to try to solve the problem, and finally I’ll share the solutions that have worked for me. Hopefully, at least one of these techniques will solve your issue with slow access to network shares.

The information in this article applies to Windows 10, Windows 8, and Windows 7.

My Scenario

While working on my Windows 10 Enterprise workstation, whenever I tried to “touch” a file (e.g., simply click, or save) on another computer running Windows 10 Pro on my network, it took anywhere from 30 to 90 seconds to save the file. I was accessing the file on the Windows 10 Pro shared folder using a mapped drive. The delay was experienced in all the applications, such as Word, Excel, PowerPoint, Outlook, File Explorer, web browsers, etc. For example, if I tried to save an attachment in my Outlook email, it would take about a minute before the system allowed me to actually save the file. Sometimes I would see the Not Responding message and my screen would simply freeze for a couple of minutes or so. If I tried to create a folder before saving a file within an application, such as Excel or Word, I experienced the same delay. Creating or renaming a folder in File Explorer was also slow.

I noticed that if I either logged on at the console or connected to the remote Windows 10 Pro computer using Remote Desktop Protocol (RDP), I didn’t experience the delay. The problem was only experienced on my local Windows 10 Enterprise computer when it tried to access data on the remote computer using the mapped drive. To summarize my connectivity:

  1. I was connected to the root of the remote computer with mapped drives (\\computername\d$, \\computername\e$, etc.). In case you are wondering, connecting to a shared folder, e.g., \\computername\HR, rather than the root of the drive, didn’t solve my problem.
  2. RDP connectivity between the two computers had no issues. The problem was experienced only with the connectivity associated with the mapped drive.

Solutions that Didn’t Work for Me, But May Help You

I tried a lot of solutions and used the process of elimination wherever possible. A complete list would be way too long, but here’s a short list, in no particular order, of the solutions that I tried. Depending on your computer and environment, any one of the following solutions may solve your problem and that’s why I am documenting them here. You can always try the solutions that have worked for me first, however, if they don’t work then try the following solutions in any order that’s convenient.

  1. Remapped the drives and recreated the shares that were causing the problem.
  2. Disabled applications that were potentially busy scanning my drives, such as Antivirus software, Enhanced Mitigation Experience Toolkit (EMET), backup software, etc.
  3. Ran Windows built-in Disk Cleanup tool on local and remote hard drives to clean the temporary and cache files.
  4. Ran the built-in Checkdisk tool on all drives on both computers, in case there were hard disk errors or broken chain links.
  5. Ran the built-in System File Checker (SFC) tool. This tool has the /SCANNOW and /SCANFILE options which scans and repairs protected system files and referenced files that may have some problems. The process can take quite some time but is worth running once in a while to ensure system integrity.
  6. Made sure that there was plenty of disk space available on both my local and remote computer. The remote computer was a bit low on free space, so I added a 2 TB drive and moved all my data to one of the new logical drives to eliminate lack of free space as an issue. This also helped with defragmentation, but because Windows 10 takes care of fragmentation in the background I didn’t expect this to make much difference.
  7. Tried various Internet Explorer settings that could have possibly affected this behavior.
  8. Tried several registry hacks related to caching, SMB, etc. If you have Windows 8.1 and earlier, you can try setting the DirectoryCacheLifetime to zero, as described here.
  9. Tried different settings in the local group policy editor.
  10. Experimented with folder options in File Explorer.
  11. Disconnected USB devices from both computers.
  12. Closed all the applications, except one, to eliminate application compatibility issues.
  13. I temporary disabled BitLocker on the drive where the data was stored. It didn’t make a difference, so I turned BitLocker on again.
  14. I disabled all the applications on the Start tab of the Task Manager. It didn’t make a difference, so I selectively enabled the ones that were absolutely necessary.
  15. I created a new user profile on my workstation.
  16. On the Performance tab of my Task Manager, I noticed that the throughput on my Ethernet card was pretty high. I switched to a different Ethernet card to see if my network card was a culprit.
  17. Rebooted the computer after trying most of these solutions.

Solution that Worked Temporarily

There was one solution to my problem that worked for a few hours. I turned off the indexing of files on the remote computer. As soon as I turned off indexing, I was able to work at full speed. I only disabled indexing on the data drives and left indexing enabled on the system drive (C). Because this may solve your issue, as it has for others, I am documenting the steps below.

  1. Open File Explorer (formerly known as Windows Explorer).
  2. Right-click the drive in question and select Properties.
  3. On the General tab, disable indexing by clearing the box Allow files on this drive to have contents indexed in addition to file properties.
  4. Click OK. Depending on your computer, the process may take a while to complete. On my drive with about half a terabyte (500 MB) data it took about 5 minutes, but your mileage may vary depending on several factors, including the amount of data, the type of data, disk speed, whether the drive is compressed or encrypted, etc.
  5. You don’t need to reboot the computer. If indexing is the reason for your slow performance, you should be able to create folders, rename files, and save files to the remote share at normal speed as soon as indexing is turned off.

Consequences of Disabling Indexing

By clearing the box in the above screenshot, you are disabling indexing of file content. This means that you won’t be able to search the contents of the files, but you will still be able to search the file properties, such as name of the file or other metadata. If you really need to search the contents of your files, then there are ways to work around this problem. You can selectively index the folders that you want by customizing the indexing functionality. Here’s how.

  1. In the Windows 10 search box type “indexing” without the quote.
  2. Click Indexing Options in the search results.
  3. Highlight a folder, e.g., Documents, and select Modify.
  4. Now you can select the folders that you want to index and clear the box next to folders that you don’t want to index. You can also create new folders as necessary to better organize your data and store files that need indexing of content into separate folders. This may not be helpful in every situation, but it’s one workaround that you may consider. You may also consider splitting data into two drives, one that contains the indexed content and the other that does not. You can save the data into the non-indexed drive so you can get the job done quickly and then later move the data to the indexed drive. Again, these are some ideas to consider. Perhaps they may lead you to some better options that are suitable for you.

As I mentioned earlier, this solution turned out to be a temporary one for me, but it has worked for others as a long-term solution.

Now here are the solutions that have worked for me.

Solution That Worked for Me in 2017

The solution that finally worked for me was to reset the TCP/IP stack. TCP/IP is the communication protocol used on the Internet. It’s also used on the private networks. Although it’s rare, but once in a while the TCP/IP stack can get corrupted. Luckily resetting TCP/IP solved my problem right away.

You can use the NetShell (netsh.exe) utility to reset TCP/IP on any Windows computer, client or server. I have documented all the details in my article How to Reset TCP/IP on Windows Computers.

Solution That Worked for Me in 2018

Things were fine until one day I started to experience the same issue I had in 2017. The network access to the shared folders became slow when I would save files in Outlook or open/save files that were on a shared network folder. I am talking about the standard network shares mapped as drives in Windows, not Distributed File System (DFS) shares. This time I modified the registry and disabled DirectoryCacheLifetime, as explained by Microsoft. This solution fixed the problem with slow access to network share immediately.

Here’s the step-by-step procedure on how I was able to resolve the issue. I was using Windows 10 Pro on the computer that was having the issue and that’s where the following change should be made to the registry. The network shares were also on a Windows 10 Pro desktop, but the registry change needs to be made on the computer that’s experiencing slow access, not the one that’s hosting the network shares.

WARNING! This solution requires modifying the registry. Modifying the registry is like doing a brain surgery on the computer. Only trained individuals who are very familiar with the Windows registry should modify the registry. The information in this article is for reference only. By following the instructions in this article, you agree to modify the registry at your own risk.
  1. In Windows Search box type regedit and press Enter to access the Registry Editor.
  2. Go to HKEY_LOCAL_MACHINE and locate System\CurrentControlSet\Services\Lanmanworkstation\Parameters.
  3. Create a new DWORD value for DirectoryCacheLifetime.
  4. Double-click the value and set it to zero (0).
    DirectoryCacheLifetime
  5. It’s not necessary to disable additional caches, but if the above setting doesn’t fix the problem, then you may want to disable two additional SMB cache values. One for FileInfoCacheLifetime and another for FileNotFoundCacheLifetime. You need to add both of them as type REG_DWORD and set the value zero (0) to disable them, if they don’t already exist in the registry.

NOTE: Whether to use DWORD or QWORD has nothing to do with the type of Windows 10 operating system (32-bit vs. 64-bit) you are using. For more information visit this article: Using DWORD vs. QWORD When Adding Values to Windows Registry.

CAUTION! It’s possible that you may experience a significant performance hit by disabling these caches. If that’s the case, simply re-enable these caches by deleting these registry keys. Deleting them will set it back to their default values, or you can manually change the values to their default settings. The default values are supposed to work for most scenarios, but that’s not always the case.

Here’s the description provided by Microsoft for each of these cache values in the article SMB2 Client Redirector Caches Explained.

FileInfoCacheLifetime: File attribute information which is contained in the File_Network_Open_Information structure which is useful in conserving network IO for retrieving common file metadata information. To disable or turn off the caching behavior the value of this registry key should be changed to 0. Turning off the file information cache is not recommended as it could nearly double the number of network transactions required for executing a given scenario. Default is 10 seconds.

FileNotFoundCacheLifetime: This is a cache of files which the client failed to open because the file was not present on the server. This prevents the client from repeatedly attempting to open files which are known not to exist on the server. This cache is likely to affect distributed applications running on multiple computers accessing a set of files on a server – where the applications use an out of band mechanism to signal each other about addition/deletion of files on the server. Default is 5 seconds.

DirectoryCacheLifetime: This is a cache of recent directory enumerations performed by the client. Subsequent enumeration requests made by client applications as well as metadata queries for files in the directory can be satisfied from the cache. The client also uses the directory cache to determine the presence or absence of a file in the directory and uses that information to prevent clients from repeatedly attempting to open files which are known not to exist on the server. This cache is likely to affect distributed applications running on multiple computers accessing a set of files on a server – where the applications use an out of band mechanism to signal each other about modification/addition/deletion of files on the server. Default is 10 seconds.

A Final Note…

If a solution documented in my article worked for you, make a note somewhere so you can quickly fix your problem if it arises again in the future. If you start to experience slow network access again in the future, look at the changes that you have already made in the past to ensure they haven’t been reversed. Sometimes Windows Update can modify your computer settings without your permission. Although this is uncommon, I have experienced it a few times.

Please share your feedback in the Leave a Comment section below.

Thanks for reading my article. If you are interested in IT consulting & training services, please reach out to me. Visit ZubairAlexander.com for information on my professional background.

Copyright © 2022 SeattlePro Enterprises, LLC. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

1 Comments

  1. “The network shares were also on a Windows 10 Pro desktop, but the registry change needs to be made on the computer that’s experiencing slow access, not the one that’s hosting the network shares.”

    This never occurred to me during my MONTHS of troubleshooting this issue that I had been having while tinkering remotely to another computer in my network and not a single other guide or forum post has mentioned this before I stumbled over your post.

    Everything is opening and saving instantly now. Thank you for this information, truly.

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar