Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Windows»How To Fix Destination Path Too Long Error

How To Fix Destination Path Too Long Error

Abhishek SilwalBy Abhishek SilwalAugust 17, 2022
destination-path-too-long

Windows has a limitation of 255-260 characters for the path length of a folder. If while transferring a folder, the new path length of the folder or any subfolder were to exceed this number, Windows does not allow transferring the files at all. Instead, it’ll give you the “Destination Path Too Long” error message.

The full path includes the drive letter, colon, name components together with backslashes as well as a terminating null character. For instance, C:\Windows is the full path of the Windows folder and it’s path length is 11.

People often encounter this issue while moving or copying saved web pages where the supporting files have very long names. They are not able to transfer some files which causes issues while viewing the web document.

In such cases, there are a few things you can do to avoid or resolve this issue, which we provide in this guide.

Table of Contents

  • How to Fix Destination Path Too Long Error
    • Rename Folder/File
    • Use Command-line Interface to Move/Copy Files
    • Substitute the Path
    • Using Compression Tools

How to Fix Destination Path Too Long Error

There are a few ways to resolve the Destination Path Too Long Error while transferring a file on Windows. Go through the possible solutions we have mentioned below and apply one according to your preference.

Rename Folder/File

The first thing you should do is rename the folders with long names along the destination path. You should also change all long names in the source folder and it’s subsequent files and subfolders. Since Windows has a maximum limit of 256 for a path, make sure the directory length (after copying/moving) of any folder or subfolder does not exceed this number.

Use Command-line Interface to Move/Copy Files

It is possible to use the robocopy utility to move or copy your files and folders while disregarding the maximum path limit.

However, robocopy is not exactly a tool intended to copy or move but synchronize two folders. So it actually transfers the contents of the source folder to the destination folder instead of transferring the source folder itself.

Here’s how you can use this CLI tool to avoid the “Destination Path Too Long” error:

  1. Open Run by pressing Win + R.
  2. Type cmd and press Ctrl + Shift + Enter to open Command Prompt as administrator.
  3. Enter the following command to copy the contents of a folder to another location:
    robocopy “Source folder path” “Destination folder path” /E /copyall
    Make sure to replace the folder paths.
  4. To move the contents of the source folder, append the flag /move to the command. i.e.,
    robocopy “Source folder path” “Destination folder path” /E /copyall /move
    robocopy
  5. If you find it difficult to enter the paths, there’s an easy way to do so:
    • Navigate to the folders in the File Explorer.
    • Right-click on the folder and select Copy as path (Don’t copy with Ctrl + C).
    • On the Command Prompt, press Ctrl + V or right-click when you need to enter the path.

Substitute the Path

Another way to resolve this issue is to substitute a long part of the path with a shorter path. In this process, you link the destination folder’s path to a new drive or another location. So, when you add files/folders to the new location, your system will update the previous location as well.

If the new path is shorter than the max path limit, this method bypasses the above error. However, if the folder you are copying itself contains subfolders with long names (more than the limit), this method may not work.

There are mainly three ways to substitute the path on a Windows OS using built-in tools. You can pick any one of them.

Substitute the Path With Virtual Drive Letter

This method creates a virtual drive and links it to a folder, the destination folder in this case. You need to use the Subst command on the Command Prompt to create a substitute drive.

However, one thing you should keep in mind is that you should not use the admin level Command Prompt.

For some unknown reason, if you use this command with the Elevated Command Prompt, you can only access the new virtual drive from the Prompt itself. But if you run the command from an unprivileged Command Prompt, you can access the drive from the File Explorer as well.

Although this has been a subject of discussion on lots of public forums, no any convincing reason has been found yet, as to why this happens. If you know the exact mechanism behind this, do let us know in the comments.

Regardless, here’s how you can associate the path with a drive letter:

  1. Open Run.
  2. Type cmd and press Enter.
  3. Enter the command subst Z: “Full path of the destination folder”. You can replace the drive letter (Z:) with any unused letter in your system.
    substitute-drive-letter

Then, copy or move any folder/file you want to the new drive using the File Explorer. If you open the destination folder using the original path, you’ll find that it now contains the transferred folders/files as well.

If you want to delete the virtual drive, you can enter the command subst Z: /d

Share Folder and Map to Network Drive

Another method is to share the destination folder and map it to a network drive. To do so,

  1. Navigate to the destination folder using the File Explorer and right-click on it.
  2. Go to the Sharing tab and click Share.
  3. Select the user account and click Share again.
  4. Copy the path under Network Path.
    mapped-network-drive
  5. Click Apply and OK.
  6. Now, right-click This PC on the File Explorer’s navigation panel and select Map network drive or Show more options > Map network drive.
  7. Select a new drive letter and paste the Network Path from step on the Folder textbox.
  8. Click Finish.

Now you can find the shared folder mapped as a network drive inside This PC ->Network Locations. Any folders you transfer to this location will appear on the destination folder.

Create Symbolic Link

You can also create a symbolic link to the destination folder. While the previous methods created new virtual drives for the folder, this method can associate any folder with another. To create a symbolic link:

  1. Open Run and enter cmd.
  2. Enter the command mklink /d “New Short Path” “Destination Path” while replacing the paths.
    symbolic-link-long-path

Similar to the above methods, transferring any file or folder to the new path will only consider the new path’s length.

Using Compression Tools

Some third-party compression tools like WinRAR and 7-zip also allow transferring files and folders along with compressing and decompressing them. The also don’t follow the 256 or 260 path character limit while transferring the files, so using them is an easy way to avoid this issue.

The exact process for each programs is different. However, we have listed the steps you need for the 7-Zip File Manager below.

  1. Open the 7-Zip File Manager using the search function (Win + S).
  2. Navigate to the the folder you want to transfer.
  3. Right-click on the folder and select Move To or Copy To.
  4. Enter the destination path. You can also click on the three-dot icon, browse the folder and click OK.
  5. Click OK to copy or move the folder.

For other apps, try performing similar steps.

fix
Abhishek Silwal
  • LinkedIn

Abhishek Silwal is an Electronics Engineer and a technical writer at TechNewsToday. He specializes in troubleshooting a wide range of computer-related issues. His educational background in Electronics Engineering has given him a solid foundation in understanding of computers. He is also proficient in several programming languages and has worked on various robotics projects. Even in his early days, he used to tinker with various computer components, both hardware, and software, to satiate his curiosity. This experience has given him a breadth of experience that goes beyond his educational qualification. Abhishek has been writing articles on dealing with varieties of technical issues and performing specific tasks, especially on a Windows machine. He strives to create comprehensive guides on fixing many system and hardware issues and help others solve their problems. You can contact him at abhisheksilwal@technewtoday.com

Related Posts

amd-software-not-opening

How to Fix AMD Software Not Opening

March 3, 2023
how to create a folder

7 Ways to Create a Folder on Windows

March 3, 2023
turn off automatic updates windows

How to Turn Off Automatic Updates on Windows

March 2, 2023
Memory-Compression

What is Memory Compression in Windows? Should You Enable or Disable It

March 1, 2023
dism-vs-sfc-vs-chdsk

DISM, SFC, CHKDSK: What’s the Difference

February 28, 2023
how-to-open-exe-file

4 Ways to Open EXE File

March 2, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
Memory-Compression

What is Memory Compression in Windows? Should You Enable or Disable It

March 1, 2023
dism-vs-sfc-vs-chdsk

DISM, SFC, CHKDSK: What’s the Difference

February 28, 2023
bios-settings-for-gaming

Best BIOS Settings for Gaming

February 16, 2023
You may also like
how-to-clean-hp-printer-rollers

How to Clean HP Printer Rollers

March 3, 2023
keyboard input lag

9 Ways to Fix Keyboard Input Lag

March 3, 2023
keyboard key is stuck

How to Fix a Stuck Key on a Keyboard

March 3, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday, editor@technewstoday.com | Tech Central Pvt. Ltd.

Type above and press Enter to search. Press Esc to cancel.