Maximum Path Length Limitation

jihad majed 500 Reputation points
2024-01-15T14:37:06.8+00:00

I did the step on this link to enable a long path, but the problem is still there, as shown below. :https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell How can I solve it still? The path is 256 characters.

Windows for business Windows Client for IT Pros Directory services Active Directory
{count} votes

Accepted answer
  1. MotoX80 36,291 Reputation points
    2024-01-17T13:48:25.82+00:00

    That is an Excel "feature".

    https://answers.microsoft.com/en-us/msoffice/forum/all/did-microsoft-roll-back-the-long-file-names/01494d63-1a75-49f9-9232-f24dd63cecee

    https://answers.microsoft.com/en-us/msoffice/forum/all/excel-365-cannot-open-the-file-because-the-file/c3394950-4aa3-433a-bbe4-cdb0c02a32bc

    The simple solution is to rename the long folder/file names to something shorter so that the total length is less than 259 as the message says.

    If you can't shorten the name, please see my answer to this post for other options. See if you can use the 8.3 name or create a symbolic link that bypasses the top level folders and effectively shortens the file name.

    https://learn.microsoft.com/en-us/answers/questions/1434888/long-path-not-working-and-i-am-unable-to-rename-th


3 additional answers

Sort by: Most helpful
  1. Azizkhon Ishankhonov 540 Reputation points
    2024-01-15T17:18:43.51+00:00

    Please restart PowerShell and try again, if it will not help try rebooting your PC.

    If this helps kindly accept the answer.

    1 person found this answer helpful.

  2. MotoX80 36,291 Reputation points
    2024-01-16T14:17:28.21+00:00

    yes ,but still the user cannot open

    Can't open what? We can't see your screen.

    Please share details what you are you are doing because while Windows might support long file names, the application that you are running might not.

    Open a Powershell prompt. Copy and paste in these commands.

    $LongFolderPath = "$env:TEMP\" + ("A" * 200) + "\" + ("B" * 200) + "\" + ("C" * 200) 
    $LongFolderPath.Length
    New-Item $LongFolderPath -ItemType Directory 
    Remove-Item  $LongFolderPath
    
    
    

    If that works, then Windows supports long file names. It should look like this. User's image

    If it fails, then run this command.

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

    Verify that it is a REG_DWORD and is set to 0x1. User's image


  3. Sheetal Gandhi 0 Reputation points
    2024-03-08T12:34:15.4466667+00:00

    Despite having the above registry key on Windows 2022, Powershell does not work with path longer than 260. Do we need anything else, e.g. specific net framework etc?


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.