Behind the Scenes at Jungle Disk - Path Length Headaches
Path Length Headaches (and Getting Around Them in Windows 10)
On occasion, we hear support requests from users that are attempting to do a large restore but encounter an issue. When restoring from the source system to a target system, occasionally the restore will fail because the restore path was too long. You will likely get a rather cryptic error message, “the system cannot find the path specified.” While it was possible to get around this using Unicode in the Windows API, there was no real solution for day-to-day use.
The example path above reads as: C:\This\Is\An\Example\Of\A\Very\Long\Folder\Path\Ending\With\What\Some\May\Consider\A\Very\Long\File\Name\But\Can\We\Go\Further\Question Mark\File for the sake of argument we will make comically long to reach the path length limitation.txt
Once you reach a path of around that length, you will hear an error noise letting you know you can’t type any further. In versions prior to Windows 10, there was sadly no real way around this. If an error were encountered, you would simply need to shorten the path.
Fortunately, in Windows 10 this is no longer the case. Getting access to longer path names is as simple as editing a single registry key. To make the change:
- Go to Start > Run
- Type: “regedit” without quotes and hit OK
- With the regedit window open, expand HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > FileSystem
From here, the steps are very important and should be followed carefully.
- Double-Click on “LongPathsEnabled”
- Change “Base” to “Decimal”
- Type “1” without quotes under “Value data: “
- Click “OK”
- Save any work you have on open programs and reboot
After making this change, you should be able restore successfully, however, you may need to still shorten the file paths you’re restoring after the fact as the 260 character limit is not gone from File Explorer.
If for some reason, however, you do need access to a file and you can’t access it via regular means, you can use command prompt and the subst command to make a new mount point for your folder. Using the path from my earlier example, use this command: subst Y: C:\This\Is\An\Example\Of\A\Very\Long\Folder\Path\Ending\With\What\Some\May\Consider\A\Very\Long\File\Name\But\Can\We\Go\Further\Question Mark
This will create a mount point at Y: for the folder “Question Mark” so you can access and work with any files/folders that exceed the 260 character limit within the “Question Mark” directory.
If you have any questions on the above recommendations, please reach out to our support team!