Can’t Delete Files in Windows Because “The source file names are larger than is supported by the file system” and How to Solve It

My Problem

While trying to delete a directory in Windows Explorer, I receive the error “The source file name(s) are larger than is supported by the file system. Try moving to a location which has a shorter path name, or try renaming to shorter name(s) before attempting this operation.”

The source file name(s) are larger than is supported by the file system. Try moving to a location which has a shorter path name, or try renaming to shorter name(s) before attempting this operation.


My Solution

First I would like to reiterate that my goal was to delete the directory and files. This solution is not about how to rename or move the file and directory names that are too long. The following will delete everything in a folder recursively!

Having said that, to delete the directories and files that are blocked from deletion because the file names are too long, use RoboCopy to mirror an empty directory over on top of the troubled directory. In my case, I did the following:

C:UsersWesleyDocuments>mkdir emptyfolder
C:UsersWesleyDocuments>robocopy emptyfolder pathtobothersomefolder /MIR

I like to be thorough, so I use the following extra flags: /V /LOG:C:mirrorlog.txt /TEE. The /V stands for verbose, /LOG sends the output to a log file and /TEE makes sure to sent the output to the command prompt screen in addition to the log file so I can watch in real time.


  1. JosephRyanRies

    January 15, 2014 at 6:01 am

    Creative… but C:> rd /s C:UsersWesley always did the trick for me! Long path names are especially troublesome in the .NET world. Here is probably the best blog post on the subject of MAX_PATH:


    • Wesley David

      January 15, 2014 at 10:43 am

      I do occasionally have a problem where I want to move files in a deep folder hierarchy to a flat hierarchy so I can access them, or rename long file names, or just print out a list of long file paths that I can’t access… and for those situations I have yet to come up with a solution.

      Potential blog post from The Illustrious Mr. Reese? =P


      • Manny Mickey

        January 15, 2014 at 11:10 pm

        The solution for your issue will be using SUBST CMD. this will create a Drive to the share/path and this reduces the 256 character limit on the path size and you will be able to rename or move files.


  2. Karpov

    May 12, 2014 at 12:07 pm

    hello every one make it simple……….
    navigate to four or five folders cut the folders to desktop and delete it……
    after that delete the folder from desktop and other


  3. Anurag Saraogi

    May 16, 2014 at 9:19 pm

    hey guys…
    you just need to rename the folder and then delete the folder


  4. Prasen

    May 31, 2014 at 10:10 am

    Everything above is CRAP!Don’t read them
    Just rename the top folder which you are trying to del or shift+del to anything short like “a” and enter into it and keep on changing the sub folder names to “b” then “c” and also make files name to “1” “2” “3” and so on….Now come back to the original folder which you named suppose “a”.Now press shift+del…File gone!!!!


    • jayke

      September 7, 2014 at 9:39 pm

      ^ we wouldnt be here if that worked


    • Bani Risset

      October 21, 2014 at 10:01 am

      Yes just do Prasen said, and done…!!! Thanks bro 🙂


    • David

      March 23, 2015 at 9:35 pm

      Renaming subfolders to one character names untill you can delete them all is a highly flawed suggestion; I have MULTIPLE directories with names longer than they should be containing many hundreds of files in a file system that has many directory levels. If I was to scan through and rename all the files to one digit files I would be here all week.

      Whilst the robocopy solution might not be pretty (IT IS a bit of a hack) it deleted my files in 5 minutes instead of the week it would have taken me.

      I AM however going to go looking for a more pure answer.


    • mattkriver

      December 28, 2015 at 11:59 am

      That was easy!!!
      I realize this won’t work for everyone but in my case this was the easiest suggestion.


    • John

      February 4, 2017 at 3:20 pm

      Ha! Ha! Worked for me!!! Alot easier than all the other B.S. here… Thanks


  5. steve

    October 3, 2014 at 12:06 pm

    renaming all parent folders to one letter let me finally drill down (to letter J) and rename the original file i wanted to delete. I was able to delete it and all parent files. Great tip PRASEN


  6. Savviety » Delete long files names – Fixed

    October 29, 2014 at 9:45 am

    […] This is a slick trick! Props out to the “The nubby admin” […]


  7. Ajit Rajthala

    November 18, 2014 at 12:51 am

    Great, i don’t know my folder was infected or what, created too many subfolders and unable to delete. this did the magic. Thanks for sharing.


  8. Lance

    June 13, 2015 at 9:32 am

    Fantastic. Works in Windows 10 as well.


  9. Mechanical Mouse (@origmechmouse)

    September 19, 2015 at 6:29 pm

    Renaming worked. I remembered doing that years ago. Thanks!


  10. Norm

    September 1, 2016 at 5:20 pm

    Pure Genius


Leave a Reply

Your email address will not be published. Required fields are marked *

Follow TheNubbyAdmin!

follow us in feedly

Raw RSS Feed:

Contact Me!

Want to hire me as a consultant? Have a job you think I might be interested in? Drop me a line:

Contact Me!

Subscribe via Email

Your email address is handled by Google FeedBurner and never spammed!

The Nubby Archives

Circle Me on Google+!

Photos from Flickr

Me on StackExchange

The IT Crowd Strava Group