Ova

How to check if Windows long path is enabled?

Published in Windows Configuration 5 mins read

You can check if Windows long path support is enabled primarily through the Registry Editor, by inspecting the LongPathsEnabled value, or via the Group Policy Editor. This feature allows Windows applications to bypass the traditional 260-character path limit, enhancing compatibility with modern file structures and development environments.

Understanding Windows Long Path Support

Historically, Windows has had a MAX_PATH limitation of 260 characters for file and directory paths. While the underlying NTFS file system supports much longer paths (up to 32,767 characters), the Win32 API often enforced this shorter limit, leading to "Path Too Long" errors for users and applications.

Starting with Windows 10, version 1607 (Anniversary Update) and Windows Server 2016, Microsoft introduced the ability to enable support for Win32 long paths. Once enabled, applications that opt-in can use paths exceeding 260 characters, provided they are built to support this functionality.

Methods to Check Long Path Status

There are several ways to verify if long path support is currently enabled on your Windows system.

Method 1: Using the Registry Editor (Regedit.exe)

The Registry Editor provides a direct way to inspect the system's configuration for long path support.

  1. Open Registry Editor:

    • Press Win + R to open the Run dialog.
    • Type regedit and press Enter.
    • Click Yes if prompted by User Account Control (UAC).
  2. Navigate to the Key:

    • In the Registry Editor, navigate to the following path:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  3. Check the Value:

    • In the right-hand pane, look for a DWORD (32-bit) Value named LongPathsEnabled.
    • If LongPathsEnabled exists:
      • Double-click it.
      • If its Value data is 1, long path support is enabled.
      • If its Value data is 0, long path support is disabled.
    • If LongPathsEnabled does not exist:
      • Long path support is disabled by default.

Method 2: Using the Group Policy Editor (Gpedit.msc)

For systems with Group Policy capabilities (Windows Pro, Enterprise, or Education editions), you can check the setting through the Local Group Policy Editor.

  1. Open Group Policy Editor:

    • Press Win + R to open the Run dialog.
    • Type gpedit.msc and press Enter.
  2. Navigate to the Policy:

    • In the Local Group Policy Editor, navigate to:
      Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem
  3. Check the Policy Setting:

    • In the right-hand pane, locate the policy titled "Enable Win32 long paths".
    • Double-click on this policy.
    • If the radio button for Enabled is selected: Long path support is enabled.
    • If Disabled or Not Configured is selected: Long path support is disabled.
    • Note: Group Policy settings can override Registry settings for specific configurations.

Method 3: Using PowerShell

For quick checks or scripting, PowerShell offers a command-line method to retrieve the LongPathsEnabled registry value.

  1. Open PowerShell:

    • Search for "PowerShell" in the Start menu and select Windows PowerShell.
  2. Execute the Command:

    • Type the following command and press Enter:
      (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem").LongPathsEnabled
  3. Interpret the Output:

    • If the command returns 1, long path support is enabled.
    • If the command returns 0 or no output is displayed (meaning the value doesn't exist), long path support is disabled.

How to Enable Windows Long Path Support (If Disabled)

If you find that long path support is disabled and you wish to enable it, follow these steps. A system restart is often required for the changes to take full effect across all applications.

Via Registry Editor

  1. Open Registry Editor (regedit.exe) as described in Method 1.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.
  3. In the right-hand pane:
    • If LongPathsEnabled already exists, double-click it and change its Value data to 1. Click OK.
    • If LongPathsEnabled does not exist, right-click in an empty space, select New > DWORD (32-bit) Value. Name the new value LongPathsEnabled and then double-click it to set its Value data to 1. Click OK.
  4. Restart your computer for the changes to take effect.

Via Group Policy Editor

  1. Open Local Group Policy Editor (gpedit.msc) as described in Method 2.
  2. Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem.
  3. Double-click on the "Enable Win32 long paths" policy.
  4. Select the Enabled radio button.
  5. Click Apply then OK.
  6. To apply the policy immediately without a full restart, open Command Prompt as an administrator and run gpupdate /force.
  7. While gpupdate /force can sometimes apply the policy, a full restart of your computer is recommended to ensure all processes and applications recognize the change.

Important Considerations

  • Application Compatibility: While enabling long path support at the OS level removes the Win32 API limitation, individual applications must still be updated or designed to handle longer paths. Older software might not fully utilize this feature.
  • NTFS Limits: The actual file system (NTFS) already supports paths up to 32,767 characters. Enabling this feature in Windows 10/Server 2016+ removes the software-level restriction imposed by the traditional Win32 API calls.
  • Restart Recommended: For changes to the LongPathsEnabled setting to be fully recognized by all system components and applications, a system restart is often crucial.

Summary of Long Path Status Check

Method Location/Command Status for "Enabled"
Registry Editor HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled DWORD value is 1
Group Policy Editor Computer Configuration > Administrative Templates > System > Filesystem > Enable Win32 long paths Policy is Enabled
PowerShell (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem").LongPathsEnabled Command output is 1

For more detailed information on Windows long path limitations and how to enable them, refer to Microsoft's official documentation on the Maximum Path Length Limitation.