Aside

“The source file name(s) are larger than supported by the file system…”

13 Feb

I had a folder on my 64-bit Windows 7 Home Premium backup drive named

D:\BackupFolder\AppData\Roaming\Microsoft\AppData\Roaming\Microsoft\
AppData\Roaming\Microsoft\AppData\Roaming\Microsoft\AppData\Roaming\
Microsoft\AppData\Roaming\Microsoft\AppData\Roaming\Microsoft\AppData\
Roaming\Microsoft\AppData\Roaming\Microsoft\AppData\Roaming\Microsoft\
AppData\Roaming\Microsoft\AppData\Roaming\Microsoft\AppData\Roaming\
Microsoft\AppData\Roaming\Microsoft\AppData\Roaming\Microsoft\AppData\
Roaming\Microsoft\AppData\Roaming\Microsoft\AppData\Roaming\Microsoft\…

You get the idea. When I tried to delete this folder using Windows Explorer. I received the following message:

Windows error message: "The folder name(s) are larger than supported by the file system."

I believe that it was caused by a symbolic link in my home folder (more precisely, my lack of understanding as to how symbolic links work in the Windows environment).

To “trick” a backup application that supported only local backups, I used a symbolic link to point to a backup folder on a second hard drive (D:). Turns out when the backup application reached the symbolic link, it copied to the backup folder and began to back up the backup folder to the backup folder. The result (in my case) was the AppData folder copied onto itself recursively until…you guessed it…the path names grew larger than is supported by the file system.

Fortunately, the solution is quite simple. The link below points to the solution I found on the WindowsIT Pro site, but save yourself some time. The solution is here:

1. Create a dummy folder on the drive (D: in this example) where the elongated path lives:

md AnyFolderName

2. Copy the dummy folder to the mutant folder using the /MIR (mirror) command line switch:

robocopy D:\AnyFolder D:\BackupFolder /MIR

3. Let RoboCopy clean up the fouled folder. This could take a few minutes depending on the size of the folder.

4. Remove the fixed folder and the dummy folder:

rd /s D:\BackupFolder
rd /s D:\AnyFolder

That’s it. You are good to go.

RoboCopy’s /MIR switch tells it to mirror the source folder to the target folder. This means that RoboCopy purges any folders and files that do not match the source folder structure and content, therefore all that is contained in the backup folder when RoboCopy completes is D:\BackupFolder\AnyFolder.

Bill

Credit where credit is due: http://www.windowsitpro.com/article/jsifaq/jsi-tip-9651-how-can-i-delete-a-folder-that-returns-path-too-long-

About these ads

10 Responses to ““The source file name(s) are larger than supported by the file system…””

  1. Michael Hannelly March 10, 2013 at 9:59 am #

    Great, Simple, thanks very much.

  2. KK March 19, 2013 at 12:06 am #

    I am very tired of this long folder name problem that prevents me from deleting them. I am not good with you computers either, can you please please do it step by step. I seem to be doing something wrong thats why its not working. please help me!!

    • bmatsoukas March 19, 2013 at 4:31 pm #

      Hello KK,

      I would be happy to help out, but I need to know what you are doing step by step to try to remove the bad folder name. I believe that the instructions in this posting are correct and pretty straightforward. Are you following the posting instructions and it fails? If so, what errors are you seeing.

      Bill

  3. Felix April 7, 2013 at 8:24 am #

    Thanks a lot. This worked

  4. Tamil Selvam .P July 2, 2013 at 7:47 am #

    Its Working Good JOB!!!!

  5. Jim July 11, 2013 at 7:52 am #

    I’ve had a rouge directory on my machine for 2 years. Thank you for getting rid of it.

  6. Assem September 23, 2013 at 8:01 pm #

    use ubunto bootable disk and remove the file

  7. Samiul Sheikh Jahid October 24, 2013 at 3:08 pm #

    GSCopy Pro v6.0 (RoboCopy Alternative) with Open File Agent
    GSCopyPro is a single command-line tool (CLI) that can copy, replicate and move files from one folder to another. This folder can be on the same machine/ server or another server elsewhere. What makes GSCopyPro stand out from other competitors is the fact it works on 32-bit as well as 64-bit systems and has no restrictions. It can easily be scheduled to run as a scheduled task and fully automated. GSCopyPro also comes with an open file agent which can copy files that are locked/ opened by other processes. This feature is supported in all windows versions from widows XP/ 2003 and later.
    Go To:>> http://www.gurusquad.com/GSCOPYPRO

  8. sirisha January 21, 2014 at 5:43 am #

    Hi
    I am facing issue where I am unable to delete one folder. System is throwing error as per below:
    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.
    InternallnstanceManagementServiceBean _c6peyo_IInternallnstanceManagementServiceRemotelmpl_1036_WLStub.class
    Type: CLASS File
    size: 11.1 KB

  9. sirisha January 21, 2014 at 5:46 am #

    The below is the file location:
    D:\ora\Middleware1\user_projects\domains\base_domain\servers\AdminServer\cache\EJBCompilerCache\sdgqnliyhanv\oracle\bpm\bpmn\engine\instancemanagement\ejb

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: