Why won't Microsoft Fix File Explorer in Windows 10 to allow long file paths

Clayton Tschirhart 25 Reputation points
2024-03-12T14:09:24.4666667+00:00

OneDrive, CMD, Powershell can all create long file paths but you can't open them in File Explorer. Long File Paths seems to be enabled by default in Windows 10 now but not File Explorer. Really frustrating to be able to see the files in OneDrive with long laths but get random errors when trying to open them. The errors usually don't indicate it's a path length issue but it definitely is.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. MotoX80 36,401 Reputation points
    2024-03-15T15:15:09.09+00:00

    My laptop is Win11 Home 22H2 with LongPathsEnabled set to 1.

    I tested with this Powershell script.

    cd \ 
    $LongFolderPath = "c:\TEMP\" + ("A" * 50) + "\" +  ("B" * 50)  + "\" +  ("C" * 50)  + "\" +  ("D" * 50)  + "\" +  ("E" * 50) 
    $LongFolderPath.Length
    New-Item $LongFolderPath -ItemType Directory  
    cd $LongFolderPath 
    "This text file is in a long folder name." | out-file Long.txt
    dir
    notepad.exe  
    cd ..
    notepad.exe  
    explorer "c:\TEMP\"
    

    I see that PS is able to create the long folder name and the long.txt file. The folder name length is 262 characters.

    Screenshot 2024-03-15 083829

    Screenshot 2024-03-15 083915

    But if I try to launch a program from the long directory, I get a "The directory name is invalid" error. If I "cd .." up to a shorter name, then it works.

    Screenshot 2024-03-15 090613

    I see that explorer is able to navigate the long folder name. And when it gets to the long name it switches from "C:" to the DOS device path syntax "\?\c:" on the tab.

    https://blogs.msdn.microsoft.com/jeremykuhne/2016/04/21/path-format-overview/

    Screenshot 2024-03-15 091022

    Notepad is able to see the long folder names in the File/Open dialog.

    Screenshot 2024-03-15 090509

    As you experienced, I too get the "Destination Path Too Long" error when I try to use explorer to create a subfolder.

    See the comment "Win32 Long Paths GPO Not Working on Windows 10 File Explorer" in this link.

    https://theitbros.com/destination-path-too-long-error-when-movingcopying-a-file/

    But I was able to create additional subfolders under 'EEEEEE' using Powershell. Explorer was able to see these folders and notepad was able to edit a text file in them.

    Screenshot 2024-03-15 100749

    It would appear that long file name support is still a "work in process" in Windows. Most likely to provide backward combability and not break anything. There are several requests on the Feedback Hub to fix it. Like this.

    https://aka.ms/AAesa8r

    If you don't want to use Powershell to create long folder names, you could try 3rd party explorer solutions.

    https://superuser.com/questions/320801/alternative-to-windows-explorer-for-long-path-names

    That's still not going to help you if the application (like Excel) that is used to process the file does not support long names.

    The simplest solution appears to be to just use shorter folder names.

    2 people found this answer helpful.

  2. MotoX80 36,401 Reputation points
    2024-03-12T14:41:32.2766667+00:00

    Please see my answers in this post.

    https://learn.microsoft.com/en-us/answers/questions/1496090/maximum-path-length-limitation

    In my reply dated "Jan 16, 2024, 9:17 AM", I explain how to use Powershell to test to see that long paths have been enabled, and also check the required registry key.

    You should not have any problem using the Windows explorer to view long file paths.

    I do not know why certain applications like Excel do not support long paths.

    1 person found this answer helpful.

  3. Anonymous
    2024-03-14T09:33:09.77+00:00

    Hi Clayton Tschirhart,

    Thanks for your post. Please understand that by default, Windows uses a path length limitation (MAX_PATH) of 256 characters.

    https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx

    You can enable the long path behavior by following steps:

    1. Go to Windows Start and type REGEDIT.
    2. Choose the Registry Editor.
    3. In the Registry Editor, navigate to the following location: at__HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.__
    4. Select the entry named: LongPathsEnabled.

    Note: If the registry key does not exist, the entry can also be added by doing the following:

    1. With the FileSystem folder selected, right-click in the empty space of the Name column where the registry keys are located.

    2. Select New.

    3. Choose the DWORD (32-bit) Value.

    4. Right-click the newly added key and choose Rename.

    5. Name the key LongPathsEnabled.

    6. Press Enter.

    1. Double-click on the LongPathsEnabled entry to open the key. 
    2. In the Value data field, enter a value of 1. This will enable the long paths option.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.