Jump to content

Filenames too LONG? Can't copy 2GB worth of files. Need help please.

Go to solution Solved by mariushm,

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. 

 

 

 

 

I'm trying to copy a 29 GB folder to another drive. When I try, it gets 90% complete and starts warning me of 'filename too long' and I can either skip the file to be copied or abort the copy of ALL the files, so I select 'skip all'.

When completed I noticed 1,820 files, 263 folders which is 2 GB of files that would not be allowed to copy because the filename was 'too long'

 

Can someone give me a few workarounds for this problem?

 

Is there a way to search a folder for a certain filename size and then mark it or have it renamed to something shorter?

Or is there a setting in Windows 10 HOME? The registry?

Software to do this?

This is painful…not physically but to my brain.😧

 

Thanks.

Link to comment
Share on other sites

Link to post
Share on other sites

This may have more to do with the way the destination drive is formatted or the file structure it is set up for than the filename length. You have MBR vs GPT formatting and FAT32 vs NTFS are your file structure choices. I had something similar on a portable awhile back, couldn't copy a file that was way smaller than available space and it turned out to be a FAT32 vs NTFS thing.

I don't badmouth others' input, I'd appreciate others not badmouthing mine. *** More below ***

 

MODERATE TO SEVERE AUTISTIC, COMPLICATED WITH COVID FOG

 

Due to the above, I've likely revised posts <30 min old, and do not think as you do.

THINK BEFORE YOU REPLY!

Link to comment
Share on other sites

Link to post
Share on other sites

That's not something you can work around with a registry setting. Filename too long could also be that there are too many nested directories and the total path gets too long. In that case, reorder to file hierarchy to be less deep and if a file has a very long name, rename it to have a shorter one.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

Ah, yeah, i had to do something like that recently.  Enable long file paths, then put the files in root C: they would only work there.

 

And yes, without that trick the application will not work whatsoever,  so i guess post above is spot on,  makes sense. 

The direction tells you... the direction

-Scott Manley, 2021

 

Softwares used:

Corsair Link (Anime Edition) 

MSI Afterburner 

OpenRGB

Lively Wallpaper 

OBS Studio

Shutter Encoder

Avidemux

FSResizer

Audacity 

VLC

WMP

GIMP

HWiNFO64

Paint

3D Paint

GitHub Desktop 

Superposition 

Prime95

Aida64

GPUZ

CPUZ

Generic Logviewer

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, Mark Kaine said:

Enable long file paths, then put the files in root C: they would only work there.

Oh, please tell me how to do that in Windows 10 Home??

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, RaputerXpert said:

Oh, please tell me how to do that in Windows 10 Home??

Honestly I don't remember exactly anymore, I'll look it up (instructions are on my computer) later / tomorrow and post it when no one else does before that.

The direction tells you... the direction

-Scott Manley, 2021

 

Softwares used:

Corsair Link (Anime Edition) 

MSI Afterburner 

OpenRGB

Lively Wallpaper 

OBS Studio

Shutter Encoder

Avidemux

FSResizer

Audacity 

VLC

WMP

GIMP

HWiNFO64

Paint

3D Paint

GitHub Desktop 

Superposition 

Prime95

Aida64

GPUZ

CPUZ

Generic Logviewer

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I have already changed the Registry entry 'LongPathsEnabled' and set it to 1.
Done that more than a year ago, and it had no effect.

 

 

I have Win 10 HOME, not Pro and don't have access to Group policy editor.

Link to comment
Share on other sites

Link to post
Share on other sites

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. 

 

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

47 minutes ago, mariushm said:

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

7-ZIP, That worked!  Every folder and file compressed as STORE only and no errors.

 

THANK YOU!

Link to comment
Share on other sites

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×