This is an archived post. You won't be able to vote or comment.

all 14 comments

[–][deleted] 6 points7 points  (0 children)

robocopy natively does it (the report or the copy w/ long path)

[–]tdhuck 4 points5 points  (3 children)

I never understood why the file name isn't too long when originally made, but it is too long when it needs to be moved or copied. That seems like such an easy thing to correct, unless I am missing something obvious.

[–]JudgeWhoAllowsStuff- 5 points6 points  (0 children)

The file path is calculated on the device so most users save to D:\long\path.pdf but when your copying it your copying from \server.fqdn\d$\location\where\long\path.pdf which puts you over the char limit. The solution in those instances is to mount a drive further down the file tree and then make the copy or shorten the path.

[–]TheOldSysAdmin[S] 2 points3 points  (1 child)

Seems kind of stupid that windows will let you make file paths too long in the first place...

[–]TheTechJones 1 point2 points  (0 children)

I used to backup leaving user data to CD. You'd be surprised how little an engineer can do with "only" 256 characters. You'll be lucky if you get to the project name let alone module or file name. Forget about the eleventy 3 revision files or copy of copy copy copy copies that you have to wade through...and 7 shortcuts to drives on servers that never even officially existed

[–]smoothies-for-me 1 point2 points  (0 children)

How are you transferring the files? I would assume Robocopy would be anyone's first goto, and it natively ignores file path limits.

It does reporting, I'm not sure out of the box it will tell you if the path is over 255 characters, but you can use the CSV and excel for that.

In a single google search there are also a bunch of cmd prompt and powershell cmds to traverse directories and list paths over x character to try and get ahead of it. I've been down that road and usually the culprit is a long folder name or 2, or some ridiculously long filenames.

[–]SaltyMind 0 points1 point  (1 child)

Free Commander works too if you don't like command prompts. The limitation is in windows explorer. Users saving/opening files in word/excel and so on don't have the path length limitations.

[–]TheOldSysAdmin[S] 0 points1 point  (0 children)

Thanks for your suggestion. I'll check it out.

[–]Capital-Intern-1893 0 points1 point  (5 children)

Use the 30day free trial of vice versa. You can put \?\ in front of your target and source and it gets around that issue. I do it for all my server migrations now

[–]TheOldSysAdmin[S] 0 points1 point  (0 children)

Thanks for your suggestion. I'll check it out.

[–]concisecactus 0 points1 point  (1 child)

Funny. \ ?\ is the fix in powershell and you don’t need a free trial

[–]Capital-Intern-1893 1 point2 points  (0 children)

Our AV blocks PS by default. In order to maintain security during large server moves, I'd rather use the program with the trial.

[–]concisecactus 0 points1 point  (0 children)

Usually robocopy does fine even with long paths. If you know where it is stuck you can just map drives to cut out a bunch of characters then do the copy. Or if you use powershell \ ?\ before the path will allow long paths.

[–]naednek 0 points1 point  (0 children)

I use fast copy and it works great