copying files that the path is too long

Hi, I have a client that has super deep directories, they can keep making them, but when I try to use Robocopy or GSCopy pro it errors out if the folder path is too deep.

Question, is there a way to copy around files when the data path is super deep?  a command line program would be my first choice, but I'll adapt.

Thanks all.
LVL 2
DanOwnerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jmcgOwnerCommented:
I think the free utility FastCopy can handle this problem. It has a command-line interface as well.
0
Joe Winograd, Fellow&MVEDeveloperCommented:
There was a thread about this here at EE last year where this tool was recommended:
http://longpathtool.com/

I have not tried this myself, but am simply passing it along for your consideration. Regards, Joe
0
jmcgOwnerCommented:
This thread on Tom's Hardware included an allegation that the longpathtool.com demo created a long path that could not be removed without purchasing the program. Just sayin'.

I've found that such problematic files can be dealt with successfully by using a DOS window "dir /x" command to obtain the short name. Deleting the file via the short name works. Or rmdir on a problematic folder, once you've emptied it out. But it gets pretty tedious if the folder hierarchy is deep.
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

☠ MASQ ☠Commented:
I'd also caution about longpathtool, this site did get spammed a bit last year by them in threads containing those keywords.

Have you tried using Unicode file naming to copy in Robocopy

"\\?\C:\Longname\"

Should copy any long path name from C:\Longname
(You need that closing backslash)

\\?\ works because it uses Unicode not Windows file naming
0
Joe Winograd, Fellow&MVEDeveloperCommented:
Here's the EE thread where Long Path Tool was mentioned:
http://www.experts-exchange.com/Networking/Network_Management/Q_28497775.html

Lots of other stuff in there. A worthwhile read for anyone with this issue.

And here's another, more recent, Tom's Hardware thread where Long Path Tool was mentioned:
http://www.tomshardware.com/answers/id-2287767/file-long-copy-laptop-fine-external-hdd.html

I haven't tried it because my file manager handles long file names just fine. I've been using the excellent Total Commander as my file manager for many, many years:
http://www.ghisler.com/

When trying to copy a too-long-file-name, it gives a dialog saying that the target name length is more than 259 characters and offering to keep the name, keep all, skip the file, skip all, rename, or abort. The release notes from the version that implemented this feature (in 2009) said;
Support for file names longer than 259 characters (up to 1022) in most file operations
Also, to avoid the dialog mentioned above, you may set an option called LongNameCopy in its configuration file, as follows:
LongNameCopy: During file operations, warn if target name is longer than 259 characters:
0=always
1=never
2=if source name isn't longer than 259 characters
3=disallow long names
Regards, Joe
0
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.Commented:
Or use the subst command to make the path shorter.

Example

Instead of C:\abaddef\efefefefef\efeefef\eeggg

use

subst z: C:\abaddef\efefefefef\efeefef\eeggg

and then copy z: across.  Now this depends on your folder structure as to whether that would be satisfactory or not.
0
oBdACommented:
Try robocopy again; I know for a fact (that is, I personally copied long paths with it) that it supports long file paths, up until the absolute NTFS limit of about 32000 characters, since and including the version from the W2k3 Resource Kit Tools.
You can just use the regular "robocopy.exe C:\Source\Folder D:\Target\Folder *.* ..." notation.
Make sure you use the version native to Windows Vista or later (in %Systemroot%\system32). If you're stuck with XP, use the one from http://www.microsoft.com/en-us/download/details.aspx?id=17657.
And just in case: do not use the /256 option, it will disable the long path support.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DanOwnerAuthor Commented:
So I'm getting that robocopy will copy as long as I use a trailing "\" in the path?

c:\data\
not c:\data
0
oBdACommented:
The trailing backslash has nothing to do with it. In addition, if you need quotes around the path because there's a space in the name, the backslash will escape the closing quote and lead to errors.
Just forget about the long path and let robocopy do its job. It's that easy. Really. Been there, done that.
%Systemroot%\system32\robocopy.exe "C:\Source\Folder" "D:\Target\Folder" *.* /e /r:0 /w:0 ...

Open in new window

0
zalazarCommented:
The XP010 version of robocopy and higher do indeed not have a problem with long paths.
I would actually use the latest standalone version available which is version XP026.
You can download it here:
http://technet.microsoft.com/en-us/magazine/2006.11.utilityspotlight.aspx
http://download.microsoft.com/download/f/d/0/fd05def7-68a1-4f71-8546-25c359cc0842/UtilitySpotlight2006_11.exe
The package does also include a GUI.
The GUI does use the installed "robocopy.exe" file.
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows     ::     Version XP026
-------------------------------------------------------------------------------

You can use this "robocopy.exe" from the command line and also copy the file to another computer and run it from there.

As the utility is very old I'm actualy not sure if the utility installs correctly on Windows 7 and higher. On Windows XP/2003 the setup works fine. The robocopy.exe file can however be used without any problem on Windows 7 and higher.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.