How to Change SMB Directory Leasing Timeout in Regedit

Server Message Block (SMB) directory leasing improves network file-sharing performance by caching directory listings and file metadata on client machines. In Windows, the duration and timeout behavior for SMB directory cache and leasing operations are managed through specific registry values located in the Windows Registry (regedit). Modifying these parameters allows network administrators to fine-tune caching durations, balance network traffic, and resolve latency or consistency issues during shared folder access.

The Primary Registry Value: DirectoryCacheLifetime

The specific registry value that controls the duration for SMB directory leasing and caching operations on a Windows client is DirectoryCacheLifetime.

When a client queries a directory over SMB2 or SMB3 with directory leasing enabled, the server grants a directory lease. The client holds directory metadata locally for the duration specified by DirectoryCacheLifetime before requesting updated metadata from the server. Setting this value to 0 disables directory caching entirely.


Along with DirectoryCacheLifetime, Windows uses two additional values in the same registry path to control file information and missing file cache timeouts:

1. FileInfoCacheLifetime

2. FileNotFoundCacheLifetime


How to Configure DirectoryCacheLifetime in Regedit

  1. Press Windows Key + R, type regedit, and press Enter to open the Registry Editor.

  2. Navigate to the following path:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
  3. Look for the DirectoryCacheLifetime entry in the right pane:

    • If it exists, double-click it, select Decimal, and enter the desired timeout duration in seconds.
    • If it does not exist, right-click an empty area in the right pane, select New > DWORD (32-bit) Value, name it DirectoryCacheLifetime, and set the timeout value in seconds.
  4. Click OK.

  5. Restart the computer or restart the Workstation service (LanmanWorkstation) to apply the changes.