HomeLinuxFix ‘Source Path Too Long/Destination Path Too Long’ Error

Fix ‘Source Path Too Long/Destination Path Too Long’ Error

The “Destination Path Too Long” or “Fix ‘Source Path Too Long” error can occur when you try to move, copy, or extract a file into a directory. The total path length allowed in Windows is 260 characters. If someone creates or attempts to modify a file or folder through this path, the system may show these errors.

Example of a Long Path:

When you have directories nested within each other like that, Windows tends to have a tough time managing them.

Enable Long Path Support in Windows 10/11 (Permanent Solution)

Windows 10 and 11 come with a hidden feature that lets you use longer file paths, but it’s turned off by default. Turning it on can provide a permanent solution to the issue.

  1. Press Windows + R to open the Run dialog box.
  2. Type gpedit.msc and hit Enter to open the Group Policy Editor.
If your machine did not show “Group Policy Editor” in the Windows search, expand this section by just clicking on this sentence to get steps to install it! 👆
  1. Press the Windows key on your keyboard and search for “Command Prompt” in the Windows search.
  2. Right-click Command Prompt from the result and click Run as Administrator.
  3. Execute the below codes in the command prompt and make sure to reboot the system after successful completion of the below codes in the Command Prompt.
FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F")
FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F")

After rebooting the device, open the Command Prompt as an administrator and execute the command gpedit.msc to open Group Policy Editor.

  1. In the left-hand panel, navigate to:
    Computer Configuration > Administrative Templates > System > Filesystem > NTFS.
  2. On the right, double-click on Enable Win32 long paths.Select Enabled and click OK.

Your Windows system can now manage file paths that are longer than 260 characters.

Shorten the File Name or Folder Name (Easiest Solution)

As the heading suggests, shortening the file/folder name can be the most effective and easiest solution you can try.

This should work for most cases. If not, don’t worry—there are other solutions you can try.

Move the File to a Higher-Level Folder

If renaming doesn’t help, try to move the file up a few folders to the topmost drive; this will trim the path, too.

  1. Navigate to the file or folder where this error is occurring.
  2. Cut the file: right-click → Cut or Ctrl+X. Go to one of its parent directories—for example, Documents—or directly from **C:** itself, and hit Paste in the right-click menu or use Ctrl+V.

Use the Command Prompt to Move or Delete Files

If you are comfortable using Command Prompt, you can easily work around moving or deleting a file from there by avoiding the long path error. Here is how:

Press Win + R and in the opened window type cmd then press Enter. Use the command cd then enter the folder the file is in. For example:

cd C:\Users\YourName\Documents\Projects

Once you’re in the right folder, use the move or del command:

To move the file:

move "VeryLongFileName.txt" C:\NewLocation\

To delete the file:

del "VeryLongFileName.txt"

The “Source Path Too Long” / “Destination Path Too Long” error can be a headache, but it’s something you can fix with the solutions covered in this blog. Whether you’re shortening file names, enabling long path support, or using other techniques, there’s a solution that will work for you. Try one or more of the methods above, and you’ll be back to working with your files in no time.

Scroll to Top