How to Copy Long File Names in Windows

long-path-namesThis article describes how to copy long file names in Windows. The steps shown below work on XP, Vista, 7, 8, or Windows 10 and on all Windows Server platforms beginning with Windows Server 2003.

Copying long file names doesn’t have to be a pain to do but unfortunately, it is! Many utilities do not work properly with very long file names beyond 240 characters.

Even more unfortunate, Windows itself cannot handle long path names, even in Windows 10! To be precise, Windows Explorer does still not offer functionality for very long path names, but Windows internally supports over 32,700 characters! That’s why you can create files but later can’t access or delete or copy them! Bizarre, isn’t it? When we look at an average Windows Server used as a file server, 240 characters aren’t much really, as people tend to organize their files in hierarchies.

Now, here is a rock solid way to copy long file names in Windows.

Step 1: Set up a Task

Download BackupChain and create new General File Backup task. The beauty here is tasks can be set up once and repeated if need be, also via a scheduler. Or it can be a one time thing, you’re the boss!

long-file-copy-create-task

 

Step 2: Add Source Folders

Now you select all folders where the long path names are an issue–the source folders. Those can be either local or from a network share:

select-folders

Step 3: Set No File Processing Settings

At the next screen we basically tell BackupChain to not process files and to just copy them.

long-file-copy-no-processing

 

Step 4: Set Target Settings

In this example, I want to copy the folder to a network share on \\myserver:

 

network target copy settings

 

Step 4: Save the Task

We now save the task and edit the settings. The main screen looks like this:
saved-task

 

Optional Step 5: Set the ACL Copy Option

For file shares where permissions are set on different files and folders, it’s best to preserve that info and turn on ACL handling.
This is done in the Options tab; check Backup ACLs as shown below:
backup-acls

 

Optional Step 6: Set Retention Settings

If you plan to use this task repeatedly, you may want to change the default retention settings in BackupChain to suit your needs.

retention settings

Here you can specify what files you want copied and how many revisions you would like to keep. For example, you could set up BackupChain to keep just one copy of each file, as shown above. The *.* extension means the rule applies to all files. However, you could also keep more than one copy.

If you wanted to keep the last 10 revisions to your Word Documents, you would enter a new line with *.docx or *.doc and set ‘number of backups’ to 10 or whatever number you need. This type of retention is unique in BackupChain and can be used in various different ways.

There a quite a few solutions you can craft with this server backup software and particularly the screen above, regardless whether you use it on Windows 10 or Windows Server 2012 R2, the features for file server backup are the same.

So after all this, problems with copying long file path names should be a thing of the past!

Why I Wouldn’t Copy Files With Windows Explorer

Simple answer: Windows Explorer is quite lacking, even on Windows Servers. On Windows 10 they put even more fancy graphics but the underlying issues are still the same.

Copy commands may fail and it might simply close the window without even telling you it failed! It does the same when it finishes, so what happened, did it succeed?

Also when things fail and when it does display a message, it may sit and wait there forever for an answer.

What we really want is a copy job that is reliable. When there are errors we want a log to trace them so we can fix them. When things succeed, we want to be able to confirm it. And also, many copy jobs are repetitive so you would want to schedule it or somehow save the settings so you can repeat the task with a simple click.

Furthermore, this article is about copying long path names beyond 240 characters, which also doesn’t work with Windows Explorer. But as you see, the file name length limitation is just one of many shortcomings of the popular Windows Explorer!

I solved all of the above issues using BackupChain as my main tool.

Long file names and Hyper-V

Since I spend quite some time with Hyper-V backup, I’ve seen lots of cases where long file names and Unicode file names break some systems; however, BackupChain handles long names without issues.