Fix: The file name(s) would be too long for the destination folder error message

Recently while browsing through some of my backup files and folders on my Windows 8 PC, I came across some old backup files that I wanted to delete. I did not have any use for an old backup, so wanted to delete the compressed .tar file.

But when I went on to delete it, I received the following error message:

The file name(s) would be too long for the destination folder

The file name(s) would be too long for the destination folder

Apparently, the compressed file contained a JPG image file, which my Windows 8 was unable to delete. Using the Skip option, I deleted all but this file. Now why did this happen?

Under standard  Windows file naming system, the total name cannot or path exceed 259 characters. This includes the folder path, file name and file extension. If it does, then when you try to delete it, you will receive this error.

Maximum Path Length Limitation: In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is “D:\some 256-character path string” where “” represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string) says MSDN.

Filename too long for destination folder

Now in my case the full folder path was:

D:\ Site Backups\ Misc\ backup-4.7.2012_23-41-31_thegadget.tar\ backup-4.7.2012_23-41-31_thegadget\ backup-4.7.2012_23-41-31_thegadget\ homedirect\ 2\ public_html2\ wp-content2\ uploads\ 2011\ 08

And the file name was really long to – like Music-producer-…-and-video-games.jpg – as can be seen in the image.

I opened its location and tried to delete or rename the file. I was not even offered the option to do so.

File name too long 2So I went ‘Back’ to its subfolder and tried to delete it. No success. I received the same error message.

File name too long 3I then used the Move To folder option to move the folder to my D Drive. This worked! The path had suddenly become shorter, and I was able to delete.

This simple trick worked in my case, and I hope it helps you too.

Sometimes simply rebooting, running Check Disk or using third-party delete freeware are also known to help delete undeletable files and folders.

If nothing helps, then you may want to have a look at this Microsoft thread where some advanced ways have been suggested using CMD and Robocopy.

Posted by on , in Category Windows with Tags
Anand Khanse aka HappyAndyK is an end-user Windows enthusiast, a Microsoft MVP in Windows, since 2006, and the Admin of Please create a System Restore Point before trying out any software & be careful about any third-party offers while installing freeware. Add me on Google+.
  • der spud

    I use ztree (Kin to the old xtreegold) to change the name, eg. xyz.gar then delete. Ok, I’m a dinosaur but never found a simpler tool.

  • leslysab

    Try Long Path Tool software for an easy fix.

  • Zod

    don’t forget our old pal xcopy. Microsoft also makes a utility called SyncToy that may work.

  • ThĂ­ch ? R?p

    thank you, i try and success

  • Rahul

    really the best concept I learnt from here after trying 10+ different websites

  • Giann Ramasatya

    Just rename the folder and rename the file

  • alexon

    Well, you can use Long Path Tool, it works good!

  • n

    a not much smart alternative might be just zip/rar the folder and copy and open it at the destination folder after paste.

  • Thorson

    Thank you! Simple solution with no download required!

  • Thorson

    I downloaded that program and it wanted me to pay to use their features. Not what I would consider “easy”.

  • Michelle

    Move to folder was NOT an option. But, I was able to move up to a higher folder, rename to a single letter, which then allowed me the option to rename my file to a shorter filename. Then I was able to 1) Move the file to the location I wanted to move it, and 2) name the higher folder back to the original name.

  • Tyrion

    it really helped and its easiest way to do that… thanx

  • F Granados

    the easy way to fix this problem is long path tool,i tried it is easy to use.





  • Dush

    if you cant rename the long file name do rename some of the long parent directories and it works!

  • Kay

    i used linux for a while an d it created file names too big for windows to delete+these files cannot be opened or renamed….i tried moving files to D drive to make shorter file name but they wont move!!!

  • MZ

    Thank you so much for this simple solution.. searched so much and finally your comment helped.

  • TekCroach

    Yes, this is handy, and I have been doing it when I burn dvd’s with very long file names.

  • TekCroach

    Always working solution. :)

  • integrators

    Simple fix … nothing to download, no tools. Just use SUBST.EXE command.
    Substitute a drive letter for the source path and another for the destination path (may not be necessary depending on local copy/folder/network location) … copy/move files between these two virtual drives with no problem as path is now much shorter …
    i.e. subst m: c:usersownermusicitunesitunes mediamusicvarious artists1980best of the 80s
    subst n: \networkstoragearchivemusicoldiesthe 80s

  • Patrick8

    Hi Der spud.
    i have a prblem like u. :)
    I suggest to try “Long Path Tool” program on google. maybe it can help u.

  • julias4

    long path tool are also help you for this situation. Thanks

  • Patrick8

    i suggest u to try using “Long Path Tool” program, i think its solving your problem

  • Alex

    I used winrar “add to archive” and selected “delete files after archive” and then i deleted archives and done!


    Long Path Tool Program is an easy way to solve this problem.

  • Recent Comments