The filename would be too long for the destination folder server 2012

Hi Supports,

We have facing some problem in win 2012 server.I am copy file to server and come to error message is as follow: the filename would be too long for the destination folder server 2012.

Thanks & regards,



December 29th, 2014 11:58am

Hi Roshan,

This happens usually when you are trying to copy files from NFS fileshare to Windows which has a character limit on filenames.

"The Windows API has a logical limit of around 255 characters and the behaviour of the described problem is consistent with this."

How long can a file name be?   

It depends on the length of the complete path to the file (such as C:\Program Files\filename.txt). Windows limits a single path to 260 characters. This is why you might occasionally get an error when copying a file with a very long file name to a location that has a longer path than the file's original location.


You can use some tool like copy, xcopy or something to rename the destination file before it gets copied.

How are you currently copying the files.

You can try Robocopy:

The Robocopy command line utility, which is natively deployed with Server 2008 and server 2012, will overcome the Windows API limit and allow the copying of files / folder paths longer than 255 characters.

A sample command is included below:

robocopy SOURCE(MountPoint) DESTINATION(Production data path) /E /ZB /COPYALL /DCOPY:DAT /log:C:\LOG.TXT /NJH /TEE


Explanation of Robocopy switches

/E to copy everything including empty folders
/ZB to copy files in restartable mode (to survice a network glitch), then if it fails uses backup mode
/COPYALL copies everything including ACLs
/DCOPY:DAT copies all directory information including timestamps and attributes
/LOG:C:\log.txt outputs all information into a log file
/NJH hides the job header
/TEE also outputs to the screen


Free Windows Admin Tool Kit Click here and download it now
December 29th, 2014 2:02pm

Hi Roshan,

I'm using Long Path Tool for these kind of problems

February 12th, 2015 7:10am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics