# “File path too long” error when copying files in Windows SBS

It was painful when you need to copy large amount of data from one server to the other and came across this “file path too long” error. That means you will need to dig into each subfolder to either rename the file or zip them up. That would take all night if you have a lot of this errors. I had this problem today.

What I am doing is helping a client migrate Windows SBS 2008 to Windows SBS 2011. There are over 200G data to copy across. For the first couple of “file path too long” errors, I just mark them down until I find there are too many of them.

Quick search on Google leads me to RoboCopy . I have to say this is an excellent tool to handle exactly this case. Actually people are using this tool to do server backup too.

robocopy "\\server1\folder1" "D:\folder2" /e /z /dcopy:T /XO

A simple command line came to rescue. I can then sit back and enjoy my coffee.

Update: Just realise today that you can use robocopy to delete files as well:
create a empty folder and run this command:

robocopy e:\empty e:\to_delete /MIR /E

## 4 thoughts on ““File path too long” error when copying files in Windows SBS”

1. Alfredbin says:

Hi,

Rather than copy the files from the root of C, create a share further down
the tree. this will shorten the path. The problem is that Windows cannot
handle paths of greater than 256 chars.

e.g. Share C:\Program Files to be “PF”. So then, instead of copying from
\\machine\C\$ you would be copying from \\machine\pg. This cuts out 13 chars
from the path already. If it still does not work you just need to shorten
the path by creating the share further down the tree.

2. Krowey says:

When you encounter issues like this, you can try to use third party app like Long Path Tool. It can also help in getting rid of Error 1320 in Windows 7.

3. stevenkor says:

Try ” Long Path Tool ” is also useful in situations where you see these error messages: Cannot read from source file or disk, there has been a sharing violation, cannot delete file or folder, the file name you specified is not valid or too long, the source or destination file may be in use and many other file managing errors

4. Kartik says:

Does robocopy provides long path name support, email notification when the transfer is done and above all I dont think its easy to use. I wanted a software which does not requires manual to read first. A simple and powerful software then one of my friend suggested me to use GS Richcopy. It provides many exciting features like email notification when transfer is complete, multi threaded file transfer, long path name support and many more.