Export file length

I exported 50,000 emails as a backup.
For some reason Em Client saved the .eml files with file names longer than 255 characters, which is a longer file name than my Windows operating system can handle.

So, now I have 50,000 eml files I am unable to copy, move, and rename.

Why did Em Client do this?
and, what should I do to remedy the situation?
Many Thanks

We don’t create filenames longer than 256 characters. However, the OS also takes into account the path, so that may be a contributing factor.

Files are created using the date and the subject of the email. You may have a few emails with very very long subjects, but surely it is not all of the files that have long file names? You can use a command prompt to rename the ones with long names, or to delete all the files.

Hi Gary, Thank you for your response. Not all of the files have problematic names. However, it is significant.
You say a command prompt command can be used to reduce the lengths. What is the command to reduce the file name of 10,000 files? Many Thanks.

You can use the rename function in a command prompt.

If you have many files to rename, you will need to use an app to do that. There are some in the Microsoft Store, or you can search elsewhere. Many have options like specifying how many characters are kept from the beginning of the name. Probably that will be a better option if you regularly get messages with very long subjects that you have exported, and your path results in the 256 character limit being exceeded.