[GH-ISSUE #146] [FEATURE] Long Path Support #142

Closed
opened 2026-02-25 21:32:44 +03:00 by kerem · 10 comments
Owner

Originally created by @jimspoon on GitHub (Aug 20, 2021).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/146

Originally assigned to: @clechasseur on GitHub.

Even though I have LongPathsEnabled with this registry key, [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001
the Copy File/Folder Path context menu option returned only the Folder path, not the File path, when the total path was 292 characters.
It would be good to have paths > 260 characters enabled.

Originally created by @jimspoon on GitHub (Aug 20, 2021). Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/146 Originally assigned to: @clechasseur on GitHub. Even though I have LongPathsEnabled with this registry key, [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] "LongPathsEnabled"=dword:00000001 the Copy File/Folder Path context menu option returned only the Folder path, not the File path, when the total path was 292 characters. It would be good to have paths > 260 characters enabled.
kerem 2026-02-25 21:32:44 +03:00
Author
Owner

@clechasseur commented on GitHub (Aug 20, 2021):

Interesting. I would've thought the shell would take care of this properly... obviously I'm doing something wrong.

<!-- gh-comment-id:902995263 --> @clechasseur commented on GitHub (Aug 20, 2021): Interesting. I would've thought the shell would take care of this properly... obviously I'm doing something wrong.
Author
Owner

@jimspoon commented on GitHub (Aug 21, 2021):

I'm not a programmer but while researching this issue I found this about an application manifest -
The application manifest must also include the longPathAware element.

XML

Copy


ws2:longPathAwaretrue</ws2:longPathAware>


https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd
No idea if this helps at all but I thought I'd send it your way!

<!-- gh-comment-id:903014444 --> @jimspoon commented on GitHub (Aug 21, 2021): I'm not a programmer but while researching this issue I found this about an application manifest - The application manifest must also include the longPathAware element. XML Copy <application xmlns="urn:schemas-microsoft-com:asm.v3"> <windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> <ws2:longPathAware>true</ws2:longPathAware> </windowsSettings> </application> https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd No idea if this helps at all but I thought I'd send it your way!
Author
Owner

@clechasseur commented on GitHub (Aug 21, 2021):

It does help, actually. I'll try it locally and see if it works.

<!-- gh-comment-id:903015896 --> @clechasseur commented on GitHub (Aug 21, 2021): It does help, actually. I'll try it locally and see if it works.
Author
Owner

@clechasseur commented on GitHub (Aug 28, 2021):

@jimspoon I have tried enabling long path support through the registry key, but am still unable to create a path longer than MAX_PATH in Windows Explorer. I am on Windows 10 20H2 so it should be supported. Is it supposed to work in Windows Explorer at all or are you using a different shell program? If Windows Explorer is not long path aware, I fear that Path Copy Copy might be difficult to convert too...

<!-- gh-comment-id:907673142 --> @clechasseur commented on GitHub (Aug 28, 2021): @jimspoon I have tried enabling long path support through the registry key, but am still unable to create a path longer than MAX_PATH in Windows Explorer. I am on Windows 10 20H2 so it should be supported. Is it supposed to work in Windows Explorer at all or are you using a different shell program? If Windows Explorer is not long path aware, I fear that Path Copy Copy might be difficult to convert too...
Author
Owner

@clechasseur commented on GitHub (Aug 28, 2021):

After doing some Googling, it does seem that Windows Explorer does not support long paths yet. I can still look into this but it is doubtful that Path Copy Copy will be able to support it if the shell doesn't...

<!-- gh-comment-id:907674523 --> @clechasseur commented on GitHub (Aug 28, 2021): After doing some Googling, it does seem that Windows Explorer does *not* support long paths yet. I can still look into this but it is doubtful that Path Copy Copy will be able to support it if the shell doesn't...
Author
Owner

@jimspoon commented on GitHub (Aug 28, 2021):

Hi Clechasseur, a single component of the path (a filename or a folder name) still must be 255 characters or less. But you should be able to string a bunch of these components together to have a folder name up to 32767 characters long.

"The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\?" prefix. For example, "\?\D:\very long path"."

https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd

<!-- gh-comment-id:907682886 --> @jimspoon commented on GitHub (Aug 28, 2021): Hi Clechasseur, a single component of the path (a filename or a folder name) still must be 255 characters or less. But you should be able to string a bunch of these components together to have a folder name up to 32767 characters long. "The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path"." https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd
Author
Owner

@clechasseur commented on GitHub (Aug 28, 2021):

@jimspoon I tried that and it doesn't work in Windows Explorer. I created two folders deep whose name are 100 characters each. Inside the second folder, I cannot create a file whose name would make the path go beyond MAX_PATH (e.g. 260 characters).

Are you able to do it in Windows Explorer on your own system?

<!-- gh-comment-id:907683354 --> @clechasseur commented on GitHub (Aug 28, 2021): @jimspoon I tried that and it doesn't work in Windows Explorer. I created two folders deep whose name are 100 characters each. Inside the second folder, I cannot create a file whose name would make the path go beyond MAX_PATH (e.g. 260 characters). Are you able to do it in Windows Explorer on your own system?
Author
Owner

@jimspoon commented on GitHub (Aug 28, 2021):

Well I just tried it and you are right! I had the registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD) set to 1. I did exactly the same thing you did and I couldn't make a third 100 character folder name that would have extended the path longer than 260. Oddly enough Voidtools Everything has no problem with it. Also the latest version of Advanced Renamer 3.88 can do it too.

I mentioned this in the Voidtools forum and the author gave a response that might be helpful - https://www.voidtools.com/forum/viewtopic.php?f=2&t=10417

<!-- gh-comment-id:907684383 --> @jimspoon commented on GitHub (Aug 28, 2021): Well I just tried it and you are right! I had the registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD) set to 1. I did exactly the same thing you did and I couldn't make a third 100 character folder name that would have extended the path longer than 260. Oddly enough Voidtools Everything has no problem with it. Also the latest version of Advanced Renamer 3.88 can do it too. I mentioned this in the Voidtools forum and the author gave a response that might be helpful - https://www.voidtools.com/forum/viewtopic.php?f=2&t=10417
Author
Owner
<!-- gh-comment-id:907690611 --> @clechasseur commented on GitHub (Aug 28, 2021): Gonna leave some useful links here: https://stackoverflow.com/questions/53918205/how-to-enable-long-path-aware-behavior-via-manifest-in-a-c-executable https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests
Author
Owner

@clechasseur commented on GitHub (Aug 28, 2021):

I've done my best to support long pathnames. With the latest build, it's possible for me to copy the full path of a file whose path is 267 characters long when choosing "Copy long path".

Will be available in the next major version.

<!-- gh-comment-id:907701867 --> @clechasseur commented on GitHub (Aug 28, 2021): I've done my best to support long pathnames. With the latest build, it's possible for me to copy the full path of a file whose path is 267 characters long when choosing "Copy long path". Will be available in the next major version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pathcopycopy#142
No description provided.