brettstone
(brett_stone2)
1
I’m moving files to a new server using robocopy, and it errors on very long filenames.
Is there a cmd line or other simple method for searching a volume/subvolumes for long names? I could then have users clean up their files before I try to move/copy them.
Is there a particular length that I should search for?
5 Spice ups
robocopy supports long file names unless you turn it off using /256
2 Spice ups
Sounds more like the whole path is too long - including the file name.
1 Spice up
You might have to create a new share further “down” the tree and then copy the files that way.
For example, you want to copy files to “C:\Long path\even longer\longer still\so so so very long” on the new server and RoboCopy says that’s too long. Create a share for “C:\Long path\even longer\longer still\so so so very long” for example, let’s call the share “Short Share”, and then copy to “NewServer:\Short Share” and it should work.
1 Spice up
Here’s a really nifty PowerShell script you could run that would tell you of any files or folder paths that are long:
https://gallery.technet.microsoft.com/scriptcenter/Function-to-get-file-and-475aeb3a
.SYNOPSIS
Function to get file and folder names with long paths.
.DESCRIPTION
This function requires Robocopy to be installed. Robocopy is used to recursively search through
a folder structure to find file or folder names that have more than a certain number of characters.
The function returns an object with three properties: FullPath,Type and FullPath.
.PARAMETER FolderPath
The path or paths which will be scanned for long path names
.PARAMETER MaxDepth
Specifies the maximum depth for files and folders in a folder structure
.NOTES
Name: Get-LongPathName.ps1
Version: 1.1
Author: Jaap Brasser
DateCreated: 2012-10-05
DateUpdated: 2013-08-28
Site: http://www.jaapbrasser.com
.LINK
http://www.jaapbrasser.com
.EXAMPLE
Get-LongPathName -FolderPath 'C:\Program Files'
.EXAMPLE
"c:\test","C:\Deeppathtest" | Get-LongPathName -FolderPath $_ -MaxDepth 200 | ft PathLength,Type,FullPath -AutoSize
2 Spice ups
da-schmoo
(Da_Schmoo)
6
There was a thread in the last week I believed that had an easy solution to this if I remember correctly - you might want to do a search and see what comes up. What I’ve done in the past is to do a redirected restore from my backup solution to overcome that problem.
1 Spice up
brettstone
(brett_stone2)
8
Oliver’s response is the most helpful so far. By mapping a volume closer to the destination the messages go away, and I can copy without errors. This gets me out of the immediate jam, but doesn’t really address the problem. --Thank you!
I’m still looking for a simple way to identify long path/filenames so that I can have the file owners shorten the names. Powershells and fancy scripts are currently over this users head. Is there not a reliable freeware that would help with this?