How to Enable Long Paths in Windows 11

A copy, an extraction or a Git clone just stopped with a path-too-long error. On Windows 11 you can lift the old 260-character path limit by turning on Enable long paths in Settings (version 25H2 and later), or by setting the LongPathsEnabled registry value to 1. One catch matters before you start: the program doing the copying must also support long paths, so check the cause first, then pick a method.

Confirm the 260-character limit is the problem

Windows has a traditional path limit called MAX_PATH, which is 260 characters. That count covers the whole path: the drive letter, the colon, every backslash, every folder name, the file name and its extension. Errors such as “The file name(s) would be too long for the destination folder” or “Filename too long” usually point to this limit.

To check a specific path, open PowerShell and measure it. Replace the example with the full path of the file that failed, including the destination folder you were copying into:

("C:\Users\<name>\OneDrive\Projects\client-site\node_modules\package\lib\file.js").Length

If the number is close to 260 or above, long paths are the right fix. If it is well under 260, look elsewhere: a single folder or file name over 255 characters, a forbidden character in a name, or a permissions problem can produce similar-looking failures.

Common places paths grow this long:

  • Developer projects, where package managers create deeply nested folders.
  • Cloud-synced folders, where the sync folder adds its own long prefix before your folders begin.
  • ZIP archives made on another system, which can contain folder trees deeper than the place you extract them.
  • Copying a nested folder into another nested folder.

Turn on long paths in Settings

On Windows 11 version 25H2 and later, the switch is on the Advanced settings page (formerly called For developers). Microsoft’s Advanced settings documentation lists it under the File Explorer group.

  1. Open Settings and select System.
  2. Select Advanced.
  3. In the File Explorer group, turn on Enable long paths. Its description reads “Remove MAX_PATH limitations from common Win32 file and directory functions.”
  4. Close and reopen the program that failed, or restart the PC, then try the task again.

Do not confuse it with Show full path in title bar on the same page. That option only changes what File Explorer displays; it does not lift any limit. If your PC has no Advanced page or no Enable long paths toggle, use the registry method below.

Turn on long paths with the registry

This is the value Microsoft documents on its Maximum Path Length Limitation page, and the Enable Win32 long paths policy controls the same setting. Because it is a plain registry value, this method also works on Home, which has no Group Policy Editor.

Registry mistakes can stop Windows from working properly, so create a backup first: in Registry Editor, use File > Export, or make sure a restore point exists you can go back to.

Option A: one PowerShell command

  1. Right-click Start and open Terminal as administrator, then approve the User Account Control prompt.
  2. Run this command, which creates the value or overwrites it if it already exists:
    New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
  3. Restart the PC (or at least the program you need).

Option B: Registry Editor

  1. Press Windows + R, type regedit and press Enter. Approve the prompt.
  2. Paste HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem into the address bar and press Enter.
  3. Double-click LongPathsEnabled. If it is missing, right-click an empty area of the right pane, choose New > DWORD (32-bit) Value and name it LongPathsEnabled.
  4. Set the value data to 1 and select OK.
  5. Restart the PC.

Set long paths by policy on Pro and managed PCs

On editions that include the Local Group Policy Editor (Home does not), you can set the same thing as a policy:

  1. Press Windows + R, type gpedit.msc and press Enter.
  2. Go to Computer Configuration > Administrative Templates > System > Filesystem.
  3. Open Enable Win32 long paths, choose Enabled and select OK.
  4. Restart the PC.

On a work or school PC, the setting may already be controlled centrally. Microsoft notes that administrators can deploy it through Intune with the Policy CSP, so if the toggle is grayed out or keeps switching back, ask your IT team rather than editing the registry.

What the setting changes, and what it leaves alone

Long paths are opt-in on both sides. Windows has supported them since Windows 10 version 1607, but Microsoft says an app must also declare support in its application manifest with the longPathAware element. Turning on the system setting does nothing for a program that has not opted in.

  • New ceiling: with the setting on, supported apps can use paths of roughly 32,767 characters.
  • Single names still have a limit: each folder or file name is commonly limited to 255 characters, whatever the total path length.
  • Relative paths keep the old limit: Microsoft says relative paths are always limited to MAX_PATH. Microsoft explains this by the \\?\ prefix used for extended-length paths, which cannot be combined with a relative path.
  • File Explorer may still struggle: Microsoft notes that the shell and the file system have different requirements, so Explorer windows and some dialogs can fail on paths that a supporting app handles fine.
  • Old programs are not affected: apps without the manifest flag keep their existing behavior.
  • Running programs may not notice: the value is read once per process, so an app that was already open keeps the old behavior until it restarts. Microsoft says a reboot might be required.

Tools with their own long path switch

Some programs ignore the Windows setting and use their own. The best-known is Git for Windows, which reports “Filename too long” during clone or checkout until its core.longpaths option is on. Run this in a terminal (administrator rights are needed for the system-wide level):

git config --system core.longpaths true

Use --global instead of --system to set it only for your account. For other build tools, backup programs and archive utilities, check their own settings or release notes for long path support before assuming the Windows switch is enough.

Check the setting, or turn it back off

To confirm the value, run this in PowerShell:

Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name LongPathsEnabled

A result of 1 means long paths are on; 0 means off. To undo the change, turn off Enable long paths in Settings, set the policy to Disabled or Not Configured, or set the registry value back to 0, then restart.

If the error keeps coming back

  • The app has not opted in. Update it, or check whether it has its own setting like Git does.
  • The app was open during the change. Close it completely and reopen it, or restart the PC.
  • Shorten the path. Move the project closer to the drive root, for example C:\Projects, or rename long folder names.
  • Use a shorter drive letter. The subst command maps a deep folder to a drive letter, for example subst P: "C:\Users\<name>\Documents\Long Folder Name", so tools that cannot handle long paths see a much shorter one. Run subst P: /d to remove it.
  • Extract archives closer to the root. When unzipping files in Windows, choose a short destination such as C:\Temp rather than a nested Downloads subfolder.

Long path questions

Do I need to restart after enabling long paths?

Not always, but it is the safest choice. Each program reads the setting when it starts, so at a minimum close and reopen the app that failed.

Does this work on Windows 10?

Yes. The same registry value and policy work on Windows 10 version 1607 and later. Windows 10 reached end of support on October 14, 2025, so moving to Windows 11 is the better long-term fix.

Is it safe to leave long paths on?

Yes. It is a documented Windows setting, and programs that do not support long paths simply keep their old behavior. The main risk is a mistake while editing the registry, which the backup covers.

Why can File Explorer still not open some long paths?

Explorer and other shell components have their own requirements, separate from the file system functions the setting changes. Use the app that created the files, or a terminal, to work with very deep folders.

With the setting on, rerun the copy, extraction or clone that failed. If it still stops, measure the path again with the PowerShell check at the top to see whether a single name or the app itself is the limit.