Sunday, September 6, 2015

windows - Source path too long - BUT IT NEVER USED TO BE


I am getting the following error while trying to copy backed up data from my external hard drive to my desktop:



The source filename(s) are longer than is supported by the file system.
Try moving to a location which has a shorter path name, or try
renaming them to shorter name(s) before attempting this operation.



And it's really annoying, and now I can't do certain things cause I can't get those files. I like to keep my stuff organized - but it looks like Windows can't support long locations - which means I can't keep things as organized as I want. But this never used to be a problem. On my old computer, I was always copying these backed up files to and fro and it's only since I got this new PC (which is supposed to be like a billion times better) that I've encountered this error.


And renaming files/folders to just 1 letter until I've copied them is not the right solution. How can I fix this? And why am I having this problem on a higher-spec pc with the same version of windows when I NEVER had this problem on my lower-spec pc with the same version of windows?


Answer



You may be nested deeper than you were previously if you are using the Windows user folders under C:\%HOMEPATH%\Documents etc. or any number of other reasons.


Flattening your structure with shorter names is really your only option. To clean up the offending directory, make sure you have your files safely stored in a new folder and clean up the old one like this:


Use the built-in command ROBOCOPY. You don't have to install anything. Create the replica of the bad folder (d:) that is totally empty (e:) on a different drive. Then run robocopy with these params.


robocopy e:\folder d:\folder /Purge /E /S /R:0 /W:0

Two more resources that should help:


With the ironically named URL...
http://vimalsuresh.com/2013/08/08/how-to-fix-file-path-too-long-error-while-copying-deleting-or-opening-files-without-using-third-party-applications/


And if you don't like CMD, a utility for getting to files that are way too long (assuming you have them backed up)...
http://backupchain.com/DeleteLongPath.html


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...