How to extend file path characters maximum limit manually?

I am trying to make a clone from mercurial repository. But, unfortunately it is refusing to clone because of the length of the file path. It's displaying as below,

           abort: The filename or extension is too long.

After trying the solutions in different articles, I can't overcome this problem. Suggest me a better solution.

Note: The articles I referred in this community doesn't solve my problem, as it is stating that it cannot be extended.

Hi Kishorejana,

I'm Stefano an Independent Advisor, here to help you.
If you need to enable path longer than 260 characters, you can follow the procedure below:

- Windows 10 Home:

1. Hit the Windows key, type regedit and press Enter.
2. Navigate to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\ CurrentVersion\Group Policy Objects\ {48981759-12F2-42A6-A048-028B3973495F} Machine\System\CurrentControlSet\Policies
3. Select the LongPathsEnabled key, or create it as a DWORD (32-bit) value if it does not exist.
4. Set the value to 1 and close the Registry Editor.

- Windows 10 Pro:

1. Hit the Windows key, type gpedit.msc and press Enter.
2. Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS.
3. Double click the Enable NTFS long paths option and enable it.

A reboot will be required.
If you are using git, you can also try this way:

Open the Github Powershell or cmd.exe (you need to have git as an environment variable) and execute the following command :

git config --system core.longpaths true

10 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi Stefano Giovanni Tamiotti ,

               Thanks for your suggestion. I am using windows 10 pro, but I can't find the Enable NTFS long paths option in the location you said in your suggestion. The options visible are Enable NTFS pagefile encryption and Short name creation options and that too already enabled. Please tell me where am I missing.

10 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Follow this other procedure if the value isn't there:

1. Hit the Windows key, type gpedit.msc and press Enter.
2. Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem
3. Double click the "Enable long paths Win32" option and enable it.
4. Reboot.

10 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I can find the above option in my system and I enabled it. But still I can't overcome that issue after rebooting also. It's displaying the same error as before.

8 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Then try this way, using Regedit:

1. Open the Start menu and type “regedit.” Launch the application.
2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
3. Right-click the value “LongPathsEnabled” and select Modify.
4. Change “Value data” from 0 to 1.
5. Click OK.

16 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It's giving the same error after changing that value too. I can able to overwrite the values as per your suggestion and the same value remains after reboot also,but when I try to clone I don't get my repository as it is displaying the same error. Any other suggestions please..

37 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated March 29, 2025 Views 50,925 Applies to: