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.
-
Open Registry Editor:
- Press
Win + R
to open the Run dialog. - Type
regedit
and pressEnter
. - Click
Yes
if prompted by User Account Control (UAC).
- Press
-
Navigate to the Key:
- In the Registry Editor, navigate to the following path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
- In the Registry Editor, navigate to the following path:
-
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
is1
, long path support is enabled. - If its
Value data
is0
, long path support is disabled.
- If
LongPathsEnabled
does not exist:- Long path support is disabled by default.
- In the right-hand pane, look for a DWORD (32-bit) Value named
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.
-
Open Group Policy Editor:
- Press
Win + R
to open the Run dialog. - Type
gpedit.msc
and pressEnter
.
- Press
-
Navigate to the Policy:
- In the Local Group Policy Editor, navigate to:
Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem
- In the Local Group Policy Editor, navigate to:
-
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
orNot 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.
-
Open PowerShell:
- Search for "PowerShell" in the Start menu and select
Windows PowerShell
.
- Search for "PowerShell" in the Start menu and select
-
Execute the Command:
- Type the following command and press
Enter
:(Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem").LongPathsEnabled
- Type the following command and press
-
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.
- If the command returns
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
- Open Registry Editor (
regedit.exe
) as described in Method 1. - Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
. - In the right-hand pane:
- If
LongPathsEnabled
already exists, double-click it and change itsValue data
to1
. ClickOK
. - If
LongPathsEnabled
does not exist, right-click in an empty space, selectNew > DWORD (32-bit) Value
. Name the new valueLongPathsEnabled
and then double-click it to set itsValue data
to1
. ClickOK
.
- If
- Restart your computer for the changes to take effect.
Via Group Policy Editor
- Open Local Group Policy Editor (
gpedit.msc
) as described in Method 2. - Navigate to
Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem
. - Double-click on the "Enable Win32 long paths" policy.
- Select the
Enabled
radio button. - Click
Apply
thenOK
. - To apply the policy immediately without a full restart, open Command Prompt as an administrator and run
gpupdate /force
. - 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.