The file name you specified is not valid or too long.

Page 1 of 2 12 LastLast

  1. Posts : 24
    Windows 10 Pro 21H1
       #1

    The file name you specified is not valid or too long.


    Windows 10 Pro Version 22H2 OS Build 19045.2364

    Getting this error on over 500 different files on an external hdd when attempting to transfer to my local disk. I have enabled long file names in Group Policy. I have reduced the folder names/file name to a single character with total path lengths being less than 30 characters, but whatever I do, this error comes up when I attempt to transfer via copy or move. I have already checked the drive for errors, none were found. I'm at a loss as to how to fix.
      My Computer


  2. Posts : 18,034
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #2

    Hello @xenosaga01,

    If I remember correctly, the file[s] length also includes the Path length.

    Try setting up a folder in the Root of a drive with a SINGLE letter as the folder name. Then copy a couple of files into it and try again.

    Also, have a look at these . . .

    > How to Make Windows 10 Accept File Paths Over 260 Characters
    > Destination Path Too Long Fix (when Moving/Copying a File)

    I hope this helps.
      My Computer


  3. Posts : 777
    Windows 10
       #3

    Hi there. You should try the alternative method to transfer these files, through Powershell. A few tips if you haven't used it before:

    > cd "insert location"

    This will get you to the directory.

    I'm no powershell user, so it's probably best for others to help further here. But here's a command you could use I found.

    Copy-Item This -Destination ThatNewFolder -Recurse

    Find out more here.
      My Computer


  4. Posts : 16,958
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    xenosaga01 said:
    Getting this error on over 500 different files on an external hdd when attempting to transfer to my local disk. I have enabled long file names in Group Policy. I have reduced the folder names/file name to a single character with total path lengths being less than 30 characters, but whatever I do, this error comes up when I attempt to transfer via copy or move. I have already checked the drive for errors, none were found. I'm at a loss as to how to fix.
    Perhaps you have a hidden invalid character within those paths.
    When I had that problem once I ended up manually renaming every folder to get rid of them.

    Best of luck,
    Denis
      My Computer


  5. Posts : 750
    Windows 10 Pro 64-bits
       #5

    The Path is part of the 256-bits file name length limitation, as indicated by Paul Black. Verify the "Path + Filename" length with the Path Length Checker:

    Download Path Length Checker - MajorGeeks

    This utility will verify, if there is and issue with file name length. Alternatively, use the Detox utility to remove invalid characters from the file names.

    You could also create an ISO image of the folder(s) and unpack it to your system and work on it there.
      My Computer


  6. Posts : 43,059
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #6

    Please do not imagine that enabling long file path in Group Policy will magically solve everything.

    It won't. Nor does it mean that everything on your PC will then support long paths. The policy reads:
    Enabling Win32 long paths will allow manifested win32
    applications and Windows Store applications to access paths
    beyond the normal 260 character limit per node on file systems
    that support it Enabling this setting will cause the long paths to
    be accessible within the process.
    i.e. not manifested (as supporting long path) = no change made when policy enabled.

    Windows Explorer (File Explorer) does not support filenames longer than 260 characters, and does not support paths to folder longer than 248 characters.

    This seems to be by design, and locked in due to some API contractual requirement related to the "MAX_PATH" variable. That group policy setting or registry setting does not change this, there are only workarounds.
    https://social.technet.microsoft.com...um=winserverGP
      My Computers


  7. Posts : 750
    Windows 10 Pro 64-bits
       #7

    dalchina said:
    Please do not imagine that enabling long file path in Group Policy will magically solve everything.

    It won't. Nor does it mean that everything on your PC will then support long paths. The policy reads:


    i.e. not manifested (as supporting long path) = no change made when policy enabled.


    https://social.technet.microsoft.com...um=winserverGP
    I can attest to that...

    My wife loves using long folder/file names that make sense to her. With all of the sub-folders created in similar manner, the path and file name length quickly got out hand. Enabling long file path in Group Policy made no difference, the Synctoy backup kept failing with file path is too long. The solution had been using utilities listed in my post before and had her change folder and/or file names to under 260 total characters, preferably under 247 characters. That's been working just fine...
      My Computer


  8. Posts : 43,059
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #8

    So.. you need a copy tool that DOES have long path support.

    Here's one I found (no particular recommendation!) - just as an example..
    Download Long Path Fixer - MajorGeeks

    - and here's another:
    FastCopy - Free File Copy Tool Runs Circles Around Explorer • Helge Klein
      My Computers


  9. Posts : 16,958
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #9

    1 Lengths You can check all lengths for yourself by using Copy as path to copy paths-filenames then pasting them nito a spreadsheet where you'll be able to use the =len() function to check all path lengths.

    2 Invalid characters You could use this approach to write a VBS/VBA script that checked for & replaced invalid characters in paths-filenames.
    How Can I Verify That All the Characters in a String are Either A-to-Z (Uppercase Letters) or the Digits 0-through-9

    Best of luck,
    Denis
      My Computer


  10. Posts : 24
    Windows 10 Pro 21H1
    Thread Starter
       #10

    Try3 said:
    1 Lengths You can check all lengths for yourself by using Copy as path to copy paths-filenames then pasting them nito a spreadsheet where you'll be able to use the =len() function to check all path lengths.

    2 Invalid characters You could use this approach to write a VBS/VBA script that checked for & replaced invalid characters in paths-filenames.
    How Can I Verify That All the Characters in a String are Either A-to-Z (Uppercase Letters) or the Digits 0-through-9

    Best of luck,
    Denis
    I have carefully examined one folder. All the files inside the folder are only 68 characters total. File Name+Path. I have verified that there are no characters that are not permitted in the file names. I have shortened folder names/file names to just 1 character. It doesn't make any difference. I am out of ideas. I have tried 3rd party tools and they dont work either.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:57.
Find Us




Windows 10 Forums