Hello Christian,
Please note that this is a limitation of the Operating System.
By default, the path that could be defined by a Windows user was 256 characters + 3 characters ("Drive:\") + 1 character (the null character that specified the end of the path) = a total of 260 characters.
Starting in Windows 10, version
1607, the MAX_PATH limitations have been removed from common Win32 file and directory functions. However, this option is not enabled by default. In order to enable it, the following registry key must be changed:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\FileSystem
In this key, the following value must be modified:
LongPathsEnabled - Changed value from false(0) to true(1)
After this step, a reboot will be required.
A test case which can be executed on a VM in order to manage the above scenario:
The second big step that must be taken in consideration here is the following element: longPathAware
which must be included in the manifest file of your application.
E.g.: <ws2:longPathAware>true</ws2:longPathAware>
Example:
Prerequisites: Visual Studio should be installed.
a. Under C:\ directory, create the following folder: a*100 (100 characters of "a")
b. Under C:\a*100, create the following folder: b*100 (100 characters of "b")
c. Under C:\a*100\b*100, create the following folder: c*50 (50 characters of "c")
d. Now try to manually create a folder. It will fail with the following error:
"The file name(s) would be too long for the destination folder. You can shorten the file name and try again, or try a location that has a shorter path."
e. The same will happen when trying to create the folder from command prompt.
f. Now modify the following registry key's value:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\FileSystem\LongPathsEnabled
from 0 to 1.
g. Restart the machine
h. The only step left is to add the "<ws2:longPathAware>true</ws2:longPathAware>" into the manifest file of our application (in our case, it is either "cmd.exe" or "explorer.exe"). By default, the cmd.exe has the earlier argument added in its manifest file. This can be seen by following the next steps:
h1. Open Visual Studio --> CTRL + O (Open File) --> System32 folder --> select cmd.exe
h2. Expand "RT_MANIFEST" and double click on "1". There we can see the above argument added
Now, if we try to create the folder from within the command prompt, we will succeed.
However, this still does not work from within the windows explorer itself. The reason behind this is the fact that explorer.exe manifest file does not contain the "longPathAware" argument. Repeat steps h1) and h2) in order to check this.
End of test case.
To be fully honest with you, I am not quite sure on what systems you are testing this scenario, as I have tested it with the exact given path (x15 New Folder) and everything worked as expected on Windows 10 (since the given path has only 182 characters).
Hope this information will be of help for you.
Best regards,
Catalin