Enable Win32 Long paths in Windows 11

How to Enable Win32 Long paths in Windows 11/10?

If you are trying to copy any file from external sources like from SD card, camera, or from the external Hard Disk, sometimes you would get an error like The file names(s) would be too long for the destination folder. The reason you receive this error is that Windows File Explorer failed to copy/delete/rename any pathname longer than 256 characters. For example, if you try to copy any file which path is exceeded more than 256 characters then windows will return the following error messages.

  • “Error cannot delete file: cannot read from source file or disk”
  • “Source path too Long”
  • “Cannot delete file or folder The file name you specified is not valid or too long. Specify a different file name.”
  • “Cannot remove folder – the filename or extension is too long”
  • “File name too long”
  • “The file names(s) would be too long for the destination folder”

The limitation is set by the Win32 API library, in Win 32 API the MAX_PATH value is set by 260. Most of the standard applications, including Windows Explorer do not work correctly with long path files exceeding 256 characters. If you are receiving the same error then the only solution is to enable the Win32 Long path in Windows 10/11.

Enable Win32 Long paths in Windows 11/10:

You can enable the Win32 Long Paths in Windows using two different methods, in the first method we are going to use the Group Policy editor, and in the second method, we are going to use Registry editor. Follow the below-mentioned methods to Disable or Enable Win32 long paths in Windows 11/10.

Using Group Policy Editor:

Open Run command by pressing Windows + R and type gpedit.msc and hit enter. This command will open the Group Policy Editor.

Now navigate to the following path.

System Configuration > Administrative Templates > System > Filesystem

From the left-hand side click on the File System and from the right-hand side look for the Policy named Enable Win32 long paths. Double click and open the Policy settings.

Then in Enable Win32long paths window, choose Enabled and click on Apply and OK. This will Enable the Win32 Long paths on your PC.

To Disable just follow the same steps and under policy settings just choose Disabled or Not_Configured to disable it.

Using Registry Editor:

Note: Modifying the Registry is risky, and it causes irreversible damage to your OS Installation Follow the steps correctly. Friendly advice Before Modifying Registry Creating Restore Point is recommended.

Open Run command by pressing Windows + R and type Regedit and hit enter. This command will open the Registry editor console.

Now navigate to the following path.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

From the left-hand side click on the FileSystem and from the right-hand side look for the DWORD named LongPathsEnabled.

Double click on the LongPathsEnabled DWORD and set the Value data as 1 and click on OK.

Enable Win32 Long paths

Close the Registry Editor and restart the system once, This will enable the Win32 Long paths in Windows 11/10.

Using PowerShell:

Open PowerShell in elevated mode and type the following command and hit enter.

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

So this command will directly add the registry value in the Windows Registry Console.

2 thoughts on “How to Enable Win32 Long paths in Windows 11/10?”

  1. I edited my “LongPathsEnabled” DWORD from “0”, to “1”, as instructed. However, after rebooting (cold, and warm), it did not change my ability to have file names longer than 256 characters. FYI – my version of Windows 11 is 64 bit.
    So, I’m still needing to find a way to support file names (and related paths) to more than 256 characters.

    Any recommendations will be highly appreciated.

    Thank you in advance.

    Sincerely,
    Dana

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top