Filenames too LONG? Can't copy 2GB worth of files. Need help please.
The filename is too long shows up when the total path (including folders) goes above around 250 characters.
This is a limitation of the Windows API and some programs that use the original Windows API could have problems opening files that have such long paths. There's a newer API (set of built in functions in the operating system) which support long paths, but applications must use those functions, and by default Windows Explorer doesn't, hence why you get those messages.
Other programs support long paths, for example try "Total commander", it should copy without any problems.
If you don't want to install other programs, the simplest solution is to simply rename some folders to short names so that in the end the total lengths of the paths will be less than 250 characters.
For example .. if you have C:\ games \ wolfenstein new blood \ .... rename games to "A" , rename wolfenstein new blood to "B" and now the path is C:\ A \ B \ .... so the total length is much shorter.
When the copying is done, you can go back and rename the folders to the original names.
Another trick you could do -if you have plenty of disk space on the destination drive - is to use a compressor that supports long file names to make an archive of the folder and then unpack that archive to the other folder.
For example, 7-zip should work. Select the folder you want to copy, choose add to archive, and select 7z but at compression level choose 0 - Store or 1 - Fastest (almost no compression, but very fast) and choose to save the archive to the new drive (or a drive with plenty of disk space)
Once the archive is done, select to extract the contents to the new drive, and 7-zip should preserve the long paths
If you have a single file or something that can't be erased or renamed, you can use the UNC paths trick which forces long paths.
For example, open a command prompt (start , then type cmd and you should see command prompt ) and if you can select Run as administrator
And there, to rename a file, you would add \\?\\ before path, which makes the operating system use long paths..
For example, the rename command is like this : RENAME "c:\path\to\filename.extension" "new_file_name.or_new_extension"
The quotes ( " " ) are optional, but needed if there are spaces in the path or file name, so best to always have them as it doesn't hurt if they're present.
But you can say :
RENAME "\\?\\C:\Temp\my very long file name.txt" "shorter name.txt"
and the \\?\\ in front of the path will force the application to use the long path and find the file there and rename it. and the file will be renamed.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now