/
/

How to Enable or Disable Win32 long paths in Windows 10

How to Enable or Disable Win32 long paths in Windows 10 blog banner image

Managing file paths can be challenging because of restrictive character limits. There’s a solution to this: Enabling Win32 long paths can allow you to go beyond the default limit and avoid other issues in complex directories, like coding projects or large datasets.

This can be a critical tool for IT professionals when managing scripts, automation tools, or legacy systems, where files can quickly exceed the default limit. This guide shows you how to enable Win32 long paths and optimize your Windows 10 setup.

Guide to enabling Win32 long paths in Windows 10

Before you use the methods below, verify if long paths are enabled on your computer. Before proceeding to enable long paths, ensure you have administrative privileges.

How to check if long paths are enabled

To determine whether your PC’s long paths are enabled in Windows 10:

  1. Press the Windows key, search “Command Prompt”, then select Run as Administrator.
  2. Enter the following command:

reg query HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled

  1. If the resulting value is “0”, then long paths are disabled (and you can proceed to either method below to enable them); if it is “1”, then long paths are enabled (and you can proceed to disable them).

Method 1: Using Group Policy Editor to enable long paths in Windows 10 Pro or Enterprise

  1. Press the Windows key, type gpedit.msc, then press Enter to open the Local Group Policy Editor.
  2. Navigate to: Computer Configuration > Administrative Templates > System > Filesystem
  3. Locate Enable Win32 long paths.
  4. Double-click the settings, select Enabled, and then Apply.
  5. Restart the PC to have the changes take effect.

Method 2: Using Registry Editor to enable long paths (for all Windows 10 editions)

  1. Press the Windows key and type regedit, then press Enter to open the Registry Editor.
  2. Navigate to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  3. Depending on whether the DWORD value LongPathsEnabled exists, do one of these steps:
    1. If the LongPathsEnabled value exists, double-click it and set the value data to “1”.
    2. If the LongPathsEnabled value does not exist:
      1. Right-click the right-hand pane, and select New, then DWORD (32-bit) Value.
      2. Name the value LongPathsEnabled.
      3. Double-click it and set the value data to “1”.
  4. Restart the PC to apply the changes.

How to revert to the default 260-character path limit

To disable long paths and go back to the default path limit, do the following:

Method 1: Using Group Policy Editor to disable long paths

  1. Press the Windows key, type gpedit.msc, then press Enter to open the Local Group Policy Editor.
  2. Navigate to: Computer Configuration > Administrative Templates > System > Filesystem.
  3. Locate Enable Win32 long paths.
  4. Double-click the settings and set the long path to Not Configured or Disabled.
  5. Restart the PC to apply the changes.

Method 2: Using Registry Editor to disable long paths

  1. Press the Windows key, type regedit, and then press Enter to open the Registry Editor.
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  3. Double-click the LongPathsEnabled value and set the value data to “0”.
  4. Restart the PC to apply the changes.

Troubleshooting Win32 long paths issues

File Explorer is still enforcing the 260-character path limit

When Win32 long paths are not working in File Explorer, even when enabled, use third-party tools like 7-Zip, Total Commander, or Robocopy to make file path changes. They help manage files beyond the limit better and can work easily with different file systems.

Some applications still show “File Name Too Long” errors

Even with Win32 long paths enabled, some applications may not support it and only use 260 characters. It often happens due to outdated legacy code or APIs. You can resolve this by making sure the application is updated to the latest version since newer releases can support long paths. Check as well that the latest patches are applied and if app configuration changes are needed.

Group Policy changes are not applying

If changes to long paths settings using the Group Policy Editor are not working, it is possible that the policies are not being refreshed in the system. You can refresh it using the Command Prompt (follow the steps above showing how to check if long paths are enabled) and run the command gpupdate /force to instantly enforce updates in the system.

After refreshing, re-check the configuration of the settings in the Group Policy Editor. Then, run the reg query HKLMSYSTEMCurrentControlSetControlFileSystem/v LongPathsEnabled command prompt to see its status.

Registry changes are not applying

If the long paths changes in the Registry Editor are not taking effect, there are a few common issues to check. First, ensure that you’re making changes with Administrator privileges, since without it, changes may not be saved or applied correctly.

Best practices for managing long paths in Windows 10

To effectively manage long paths and avoid any issues coming up, follow these best practices:

Use shorter folder and file names

Keeping names concise can help avoid hitting that 260-character limit. You can use abbreviations or simply avoid redundant naming structures.

Enable long paths for deep directories or programming projects

If your work needs deeply nested folders, like in development environments or large datasets, enabling long paths can provide smoother file access and management.

Use PowerShell or Robocopy for file operations

Third-party tools support long paths and provide features for copying, moving, or managing files without character limits.

Check compatibility before enabling long paths

Keep in mind that some applications do not support long paths. Double check compatibility with your software to avoid unexpected errors that disrupt your workflow.

Follow these practices, and you can minimize issues, improve efficiency, and ensure that your apps are compatible with long paths in Windows 10.

FAQs

Does enabling long paths affect system performance?

Long paths do not generally impact system performance. It just removes the 260-character limit for file paths, allowing applications that support it to handle long paths.

Can I enable long paths in Windows Home Edition?

Yes, but you will need to use the Registry Editor (follow Method 2 above) since Group Policy Editor is not available in Windows Home.

Will File Explorer support long paths in the future?

Microsoft has not made any announcements about adding this feature to File Explorer yet, so third-party tools like 7-Zip or Robocopy are recommended.

Do network paths also support long paths?

Yes, network paths can support long paths when enabled on both the client and server systems. However, compatibility still depends on the network file system and the application used.

What is the maximum file path length after enabling long paths?

After enabling Win32 long paths, the file path length limit increases to 32,767 characters, but some applications might use the default limits. To avoid this problem, always check software-specific restrictions.

Master long paths in Windows 10

Win32 long paths make workflows simpler and more thorough, whether in the Group Policy Editor or the Registry Editor. But keep in mind that File Explorer does not support them, even when enabled. You can effectively manage long path files by using third-party tools and built-in utilities like PowerShell and Robocopy.

These programs support long paths and organize file management tasks. Follow this guide to improve your workflow and avoid the common pitfalls when working with long paths in Windows 10.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).