locked
Can't Delete Folder, "Destination Path Too Long" Error in Windows 7

    Question

  • I've seen other similar posts, but none of them provides an actual solution that has worked for this ridiculous problem I'm having.  I'm simply trying to delete a folder from my backup drive in Windows 7, but Windows shows the error, "Destination Path Too Long:  The file name(s) would be too long for the destination folder.  You can shorten the file name and try again, or try a location that has a shorter path. " as shown here:



    Then, after I "Skip" this item, I get another similar error, but this time it says, "Source Path Too Long:  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. " as shown here:



    So, I deleted all sub folders and files in an attempt to work around this problem.  There is one folder, that is actually completely empty, that refuses to be deleted.  I moved this folder to the root of my drive, I even tried renaming it, but it never gets deleted.

    Seriously, I just want to delete this folder.  I've tried third-party utilities, checked the disk for errors, tried deleting the folder from the command line, and nothing has been able to delete this folder.  It seems like a cutting-edge operating system should be able to handle a simple delete operation without so much trouble.
    Brian Hall
    www.bhall.com
    • Edited by bhall7 Wednesday, December 02, 2009 1:54 AM
    Wednesday, December 02, 2009 1:47 AM

Answers

  • I finally deleted all of the folders by drilling down to the almost endless copies of Application Data and moving subsequent levels to the root of the D:\ and deleting piece by piece.  I have no idea how those copies were made in the first place, and secondly, why Windows makes it so hard to delete such a nasty, unwieldy folder structure.  Ugh!

    Brian Hall
    www.bhall.com
    • Marked as answer by Vivian Xing Thursday, December 03, 2009 6:56 AM
    Wednesday, December 02, 2009 6:03 AM
  • Brain,

    Could be that the robocopy script causes the recursion in the target directory tree because of junction points in the source.  I'm pretty sure the windows \User directory tree has junctions that could create this situation.  You may wish to try adding the "/XJ" option to the robocopy command so that it doesn't follow junctions.
    • Marked as answer by bhall7 Tuesday, March 23, 2010 4:01 PM
    Friday, December 25, 2009 8:09 PM

All replies

  • Can you list the full path to the file?  Based on what you posted above it looks as though it's only 180 characters, but it's hard to be sure.

    How is your backup drive formatted?  Is it NTFS or FAT32?  Properties on the drive in the My Computer Explorer window should tell you.

    You may want to reformat it to NTFS if it's the latter.  I believe NTFS allows longer path names.  NTFS is also more reliable and secure.

    -Noel
    Wednesday, December 02, 2009 1:54 AM
  • Thanks for the reply.  My backup drive is formatted NTFS, and the path to the folder I'm trying to delete is D:\Local.  I renamed it to D:\Can'tDelete, but it still won't delete.  The folder size is around 17 GB, but there are no files at all in the folder!  The funny thing is that when I attempt to delete it, it says there are items in the folder as shown in the above error messages.  I can reproduce this error by copying the folder C:\User\Username \AppData\Local\.  This is the folder that won't get deleted.  The strange thing is, it was copied from a Robocopy script to the backup drive, and I am able to completely delete all of the contents of the folder.  However, no matter when I move this folder to or what I do to it, I am always unable to delete this folder.  It's very strange.

    Brian Hall
    www.bhall.com
    Wednesday, December 02, 2009 2:41 AM
  • How do you put files on this backup drive?  Are you using Windows Backup?  If so, I've not found documentation on just how it organizes its files, but it's not inconceivable it is using long machine-generated names and folders.

    In any case, it sounds like there are hidden files there.  In Explorer, Tools - Folder Options - View tab, click "Show hidden files", and also uncheck "[ ] Hide protected operating system files".  I'm guessing there's a REALLY hugely deep folder in there somehow, and these settings could help you see it.  You probably won't want to leave these settings enabled permanently.

    By the way, a nifty freeware tool for visualizing what folders have large files or collections of files in them is Scanner by Steffen Gerlach:   http://www.steffengerlach.de/freeware/

    -Noel
    Wednesday, December 02, 2009 4:46 AM
  • The folder that I cannot delete was put there using a Robocopy script (using the /MIR command-line switch) that synchronizes my Windows profile.  I showed the protected operating system files and saw that there are many copies of Application Data within itself (consuming a massive amount of storage).  It seemed to go on literally forever, and as I navigated down the Application Data folders, the system got a little sluggish and weird.  Here is a screen shot of only a handful:



    I drilled down many layers, and periodically moved the Application Data folder to the root of the D:\ and deleted it.  Sometimes it would delete after a minute or two, and sometimes, it would show the same "Path too long" error as shown previously.  However, I did receive this curious error while attempting to delete one of the sub folders:



    I've tried WinDirStat which I think is similar to Scanner, that also shows a graphical representation of the folders and disk space consumption.  Unfortunately, it wasn't able to delete the files.

    At the moment, I'm still flailing around trying to strategically move and delete folders and sub folders, but I'm starting to get tired.  This is like a bad nightmare.
    Brian Hall
    www.bhall.com
    Wednesday, December 02, 2009 5:41 AM
  • I did notice that within C:\Users\UserName \AppData\Local\ there is a shortcut called Application Data .  This appears to be the default for all Windows 7 user accounts.  Perhaps Robocopy is copying not just the shortcut.lnk file, but the actual destination and its contents and doing this over and over until the disk fills up (which is what my last few Robocopy scripts have been doing).  If you're curious, my Robocopy script simply does the following:

    robocopy "C:\Users\UserName" "D:\Nightly\UserName" /MIR /R:3 /W:5 /NP /TEE /LOG+:"C:\Users\UserName\Desktop\BackupLog.txt"
    I'm still unable to delete the folder.

    Brian Hall
    www.bhall.com
    Wednesday, December 02, 2009 5:52 AM
  • Hm, I wouldn't expect to see many copies of folders with the same name...

    I think I'd do a CHKDSK D: next and see whether there's any file system corruption there.

    -Noel
    Wednesday, December 02, 2009 5:55 AM
  • CHKDSK returned no errors on drive D:
    Brian Hall
    www.bhall.com
    Wednesday, December 02, 2009 5:56 AM
  • I finally deleted all of the folders by drilling down to the almost endless copies of Application Data and moving subsequent levels to the root of the D:\ and deleting piece by piece.  I have no idea how those copies were made in the first place, and secondly, why Windows makes it so hard to delete such a nasty, unwieldy folder structure.  Ugh!

    Brian Hall
    www.bhall.com
    • Marked as answer by Vivian Xing Thursday, December 03, 2009 6:56 AM
    Wednesday, December 02, 2009 6:03 AM
  • Brain,

    Could be that the robocopy script causes the recursion in the target directory tree because of junction points in the source.  I'm pretty sure the windows \User directory tree has junctions that could create this situation.  You may wish to try adding the "/XJ" option to the robocopy command so that it doesn't follow junctions.
    • Marked as answer by bhall7 Tuesday, March 23, 2010 4:01 PM
    Friday, December 25, 2009 8:09 PM
  • Brain,

    Could be that the robocopy script causes the recursion in the target directory tree because of junction points in the source.  I'm pretty sure the windows \User directory tree has junctions that could create this situation.  You may wish to try adding the "/XJ" option to the robocopy command so that it doesn't follow junctions.


    It would appear the issue is a length limitation in the folder structure. I created 2 batch files in order to resolve the issue quickly. the /XJ option should prevent the issue in future. After running trial.cmd you can delete from the top level folder without errors. The messy part is that you must "end task" on the command window in order to stop the infinite loop. Control C does not work.

    In my scenario there were 2 more folders with the same problem 5 or 10 levels down from the 1st "Application Data" that I manually renamed as well. Until the tree length is short enough Windows was too unstable to find the last 2 anomolies manually.

    Prompt:\copy con trial.cmd

    ren "Application Data" a

    Prompt:\cd a

    Prompt:\trial2.cmd

    ^Z

    Prompt:\copy trial.cmd trial2.cmd

    Prompt:\edit trial2.cmd

    ren "Application Data" a

    Prompt:\cd a

    Prompt:\trial.cmd

    Save and exit.

    Tuesday, March 23, 2010 5:19 AM
  • Thank you so much for the great responses, especially the "/XJ" option in Robocopy to prevent the following of junction points!

    Brian Hall
    www.bhall.com
    Tuesday, March 23, 2010 4:02 PM
  • Hi all.  I was having the same exact problem, for the same exact reason--robocopy was following the junction "Application Data" and creating what seemed like an infinite number of folder copies.  My solution was to delete the offending folder from within Cygwin using a standard unix delete command:  `rm -rf foldername'.  Worked like a charm!

    Thanks,

    hs

    • Proposed as answer by mark.bauer Wednesday, July 07, 2010 5:17 AM
    Tuesday, May 25, 2010 4:21 AM
  • Thanks for the Cygwin tip. I was going crazy. This did it in no time flat.
    Wednesday, July 07, 2010 5:18 AM
  • I use vista but this was the only post online I could find which involved this error. I had exactly the same one - I eventually ended up renaming every sub-folder with one letter (I went through the alphabet) and just kept renaming and attempting deletion until it eventually gave in. It took a long while but I was victorious - This saves downloading any software or messing with boot commands and things.

     

    Just thought I'd put it here for anyone else who stumbles upon this silly problem.

     

    Lorraine

    Wednesday, July 07, 2010 10:06 PM
  • This is all great - if your a programmer? 

    I'm just a stupid user so would you mind giving me a step-by-step on how to execute this copmmand from the start button?

    It blows me away that MS would even allow thier new OS to operate like this without giving an end-user the ability to delete a file that was placed in "windows.old" when a fresh copy of the OS OS was installed.

    ANything you can do to help would be appreciated; the offending file was left on my C:\Windows.old\Users\Steven E. Gilbert\Desktop

    Apparently it won't let me change its protection from read only either.

    Thanks,

    S

    Sunday, July 11, 2010 4:20 PM
  • I have this issue too.

    NOTE THAT THIS IS JUST YET ANOTHER BUGGY BUGGY WIN7 PROBLEM.

    This is an exploit I plan to publish:

    You can create directories programatically that the os can not delete!

    Great for malware!!!.

    Thanks Steve! You are doing a great job!

     

     

     

    Saturday, July 24, 2010 6:01 PM
  • Jim D_

    This is not a new problem and it is not confined to build 7600, or for that matter the OS at all, but rather a limitation that is clearly documented in the all NTFS specifications, including the latest NTFS revisions.

    Your statement about malware is way off target and represents that you do not have a sufficient understanding of computer file systems, file system forensics or engineering and would be woefully unqualified to publish anything about it.  It's easy to say this is a bug, or a exploitable aspect--but if they planned that you can only have paths of certain lengths and files names of certain lengths (remember a directory is just a file name itself), that isn't a bug because it was expected and designed that way.  What would your limit be?  Something double?  There you would run into problems as the MFT entries, B-trees, index nodes, (just to name a few) etc. would all have to be totally revamped resulting in a huge expenditure of resources so you can put a folder in a folder in a folder in a folder in a folder in a folder ad infinitum then have an overly descriptive filename...?!?

    Get a book, and make a concerted effort to understand why things were done a certain way.

    The malware comment...the directories can be deleted, it just might take clever programmers who have to write applications to help those of you who can't figure this simple on out.  If all else fails, edit the MFT and any non-resident attributes for the file name.  If this was a the big problem we faced with malware, the problem of malicious code would be solved by 22:00 EDT today.  I beg you to pardon the cliche, but this isn't rocket science.

    Respectfully,

    J. C.

    Saturday, August 21, 2010 7:00 PM
  • I tried to download and install Cygwin but it was up to several GB so I cancelled it. There didn't appear to be anything there I could run. 

    I need to get rid of the folder on my external backup drive. Yes, it was created by a ROBOCOPY backup of a user folder.  The nested folders are hidden, and the hidden attribute cannot be removed.  The files cannot be renamed as they do not "exist". In a command window, I can view all this using  but everything results in an error.

    > dir H:\USERS_PAT\AppData\Local\ /s /on

    The directory name H:\USER_PAT\AppData\Local\Application Data\Application Data
    \Application Data\Application Data\Application Data\Application Data\Application
     Data\Application Data\Application Data\Application Data\Application Data\Applic
    ation Data\Application Data\Application Data is too long.

    Tuesday, August 24, 2010 2:18 AM
  • I finally deleted all of the folders by drilling down to the almost endless copies of Application Data and moving subsequent levels to the root of the D:\ and deleting piece by piece.  I have no idea how those copies were made in the first place, and secondly, why Windows makes it so hard to delete such a nasty, unwieldy folder structure.  Ugh!

    Brian Hall
    www.bhall.com


    next time it happens

    try this

    At a command prompt with elevated level (Start -> type cmd -> rightclick cmd > run as administrator)

    try the following:

    cacls D:\Foldername /T /G Everyone:F
    rmdir /s /q D:\Foldername

     

    This command should delete any folder whatsoever

     

    ceasar,

    CES Free Tech Help

     

    Friday, September 17, 2010 7:36 AM
  • J.C.

    This is not a new problem and it is not confined to build 7600, or for that matter the OS at all, but rather a limitation that is clearly documented in the all NTFS specifications, including the latest NTFS revisions.

    J.C., it is an OS limitation and NOT a ntfs limitation, an amazingly stupid one if you ask me, but could be for backwards compatibility, have a bit of a read of the info below for more technical information, but the basic issue is all windows API's including 7 are limited to 256 character path's, ntfs can support up to 32767 characters long, which is very long!! You can purchase, not sure about freeware, filemanagers that do not have this limitation...

    Edit: you can use richcopy to copy to a different location, then delete, not perfect but easier...

    http://technet.microsoft.com/en-gb/magazine/2009.04.utilityspotlight.aspx

    Unfortunately this time you can’t blame the kernel, but you can blame the windows API's, even in Win7 I believe, I am guessing this is for backwards compatibility.

    From WIKI – NTFS
    File names are limited to 255 UTF-16 code words. Certain names are reserved in the volume root directory and cannot be used for files. The NT kernel limits full paths to 32,767 UTF-16 code words.

    Have a look at this link, it does show you how to access long path, by typing "\\?\D:\<very long path>"

    http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx

    Regards

    Andrew

    • Edited by Macca25 Tuesday, October 19, 2010 12:02 PM Update
    Tuesday, October 19, 2010 11:43 AM
  • Hi.

    I had the same problem but with netbeans which built recursive folders with the root given name. I used the name “mermelada” under my c:\temp\ folder.

    I had thousands (at least) of c:\temp\mermelada\mermelada…. And so and not able to delete because the windows “name too long” message.

    I used the inspiration of another user of this issue and made a recupera2.bat with the following content

    ren c:\temp\mermelada\mermelada\mermelada x

    move c:\temp\mermelada\mermelada\x c:\temp\mermelada

    rd c:\temp\mermelada\mermelada

    ren c:\temp\mermelada\x mermelada

    recupera2.bat

    In a DOS window, I ran c:\recupera2.bat, leaved alone for 2 minutes and voila!... just a empty “mermalada” folder  ready to be destroyed.

    Good luck!

     

    Thursday, January 20, 2011 9:45 PM
  • hi, had this issue too... My eclipse, went nuts when i opened work bench and made a huge folder tree.. the problem was that folders were in this order /uge4/src/uge4/src....

    So from the post above I used the bat idea. looked like this...

    ren C:\Users\Jacob\Desktop\Java\prog2\Uge4 x
    ren C:\Users\Jacob\Desktop\Java\prog2\src x
    move C:\Users\Jacob\Desktop\Java\prog2\x\src C:\Users\Jacob\Desktop\Java\prog2\
    move C:\Users\Jacob\Desktop\Java\prog2\x\Uge4 C:\Users\Jacob\Desktop\Java\prog2\

    rd C:\Users\Jacob\Desktop\Java\prog2\x /s /q

    test.bat

    renaming the folder(s) and removing them.. used /s to remove any subfolders and /q to ignore query for (Y/N).

    And ignored the error messages ^^ had i running for some time and done :)

     

    //Rayf

     

    Wednesday, January 26, 2011 12:24 PM
  • If robocopy was the cause of this problem as was in my case you can simply add an exclude parameter to the robocopy command excluding the problem directory (i.e. /XD e:\directory) and make sure to also include the /purge and /e parameters (or the /MIR parameter which appears to be the same). Robocopy can then clean up the mess it created (that YOU and I told it create).

    If robocopy wasn't the cause and you have a version of windows that supports robocopy than you could try making the destination directory of robocopy the problem directory and then use the above parameters.

     

    • Proposed as answer by A-User Wednesday, December 28, 2011 9:31 PM
    Tuesday, February 08, 2011 4:45 PM
  • I like the robocopy option. You don't have to install anything. I created the replica of the folder on a different drive that was totally empty. Then ran robocopy with these params.

    robocopy D:\folder z:\folder /Purge /E /S /R:0 /W:0

    and it ran through it and cleaned it up very nicely.  Thanks ITLouis!

    • Proposed as answer by A-User Wednesday, December 28, 2011 9:31 PM
    Wednesday, April 13, 2011 6:35 PM
  • At a command prompt, use "dir /x" to get the short name for the directory - then do an RMDIR /s on that.
    Monday, April 25, 2011 9:42 PM
  • Thanks Ceasar!

    I've been recently having the same issue.  I reinstalled windows 7, I just wanted to delete the "windows.old" file that it creates for you with all your previous files prior to reinstall.  It eventually gave me the same msg "cant delete folder, dest path too long".  But it also said the folder was empty.  I tried your suggestion above & worked like a charm. Awesome!

    Chris


    Wednesday, April 27, 2011 2:53 AM
  • FYI, I just had the same problem.  I was successful simply moving the file with the long filename to the trashcan and deleting it!

    Worked great.  And much quicker than anything else.

    Saturday, July 02, 2011 4:54 PM
  • Unfortunately, 'rm -rf foldername' within Cygwin did not do it. It still says: rm: cannot remove `username/AppData/Local/Application Data/bla bla bla'

    Also, 'cacls D:\Foldername /T /G Everyone:F
    rmdir /s /q D:\Foldername' did not work either (tried it first actually). It just caused my disk I/O to peg and freeze up the system. Had to hold down power.

    Any other suggestions (short of reformatting)?

    Edit: ok, wait. I tried the Cygwin command again and this time it worked. Ok, well, thanks.
    • Edited by notRoman Friday, December 09, 2011 4:52 AM
    Wednesday, November 16, 2011 5:41 PM
  • I finally deleted all of the folders by drilling down to the almost endless copies of Application Data and moving subsequent levels to the root of the D:\ and deleting piece by piece.  I have no idea how those copies were made in the first place, and secondly, why Windows makes it so hard to delete such a nasty, unwieldy folder structure.  Ugh!

    Brian Hall
    www.bhall.com


    next time it happens

    try this

    At a command prompt with elevated level (Start -> type cmd -> rightclick cmd > run as administrator)

    try the following:

    cacls D:\Foldername /T /G Everyone:F
    rmdir /s /q D:\Foldername

     

    This command should delete any folder whatsoever

     

    ceasar,

    CES Free Tech Help

     

    Awesome trick. Thanks!
    Thursday, December 08, 2011 2:07 PM
  • I like the robocopy option. You don't have to install anything. I created the replica of the folder on a different drive that was totally empty. Then ran robocopy with these params.

    robocopy D:\folder z:\folder /Purge /E /S /R:0 /W:0

    and it ran through it and cleaned it up very nicely.  Thanks ITLouis!


    Brilliant - using robocopy to fix it's own mess works very well indeed.

     

    Tried this, but did not work:

    cacls D:\Foldername /T /G Everyone:F
    rmdir /s /q D:\Foldername

     

    Also, cygwin solution might work (did not try), but the installation is way too complex and massive overkill. The robocopy purge is an elegant and efficient method. 

     

    Well done ITLOUIS for the idea, and Jason7237 for the command line example.

     

    Finally, thanks for the /XJ tip - prevention is better than cure :)

     


    • Edited by A-User Wednesday, December 28, 2011 9:43 PM typo
    Wednesday, December 28, 2011 9:42 PM
  • Trying Windows Explorer or FAR to resolve path too long problem? Check out latest Long Path Tool

    Download latest path too long fixer

    http://longpathtool.com/


    Steer clear of this one... looks like their software might work (didn't bother trying), but they are looking for you to sell your first born to pay for it. For a single non-commercial license, expect to pony out $197 which includes "LIFETIME updates FOR FREE" (quoting their homepage verbatim).

    Looks and smells like spam.

    There are plenty of free alternatives which are easy to access and use.

    Meh.

    Saturday, January 07, 2012 7:32 AM
  • Actually http://longpathtool.com/ has a trojan that will attack your computer. I hope that you have a good virus scanner if you want to visit that. It would also be nice if Microsoft would clean up this thread. I've reported it now.
    • Proposed as answer by Speedy_1 Thursday, February 09, 2012 8:29 PM
    • Unproposed as answer by Speedy_1 Thursday, February 09, 2012 8:29 PM
    Sunday, January 29, 2012 10:00 AM
  • There is another easy way. If you use a development tool like Eclipse or any other Java IDE (most of them are designed to handle long deep file structure due to java packaging), and create a project at the base location of the folder's contents that you want to delete. It should recursively include all your files in the project. Now just right click (from eclipse) and delete (and make sure 'delete contents') option is checked if you delete at the project level. 
    • Edited by Speedy_1 Thursday, February 09, 2012 8:35 PM
    Thursday, February 09, 2012 8:32 PM
  • I had the similiar problem and finally I found solution:  http://LongPathTool.com
    Wednesday, March 14, 2012 11:27 AM
  • From the command prompt this works the best.  On the folder just use this command and all files under the directorys gets deleted including the long file names.  Then you can simply delete all the folders using windows delete.

    del /F /S /Q /A "Your Directory"

    Friday, May 04, 2012 8:52 PM
  • If robocopy was the cause of this problem as was in my case you can simply add an exclude parameter to the robocopy command excluding the problem directory (i.e. /XD e:\directory) and make sure to also include the /purge and /e parameters (or the /MIR parameter which appears to be the same). Robocopy can then clean up the mess it created (that YOU and I told it create).

    If robocopy wasn't the cause and you have a version of windows that supports robocopy than you could try making the destination directory of robocopy the problem directory and then use the above parameters.

     

    Genious

    That saves alot of time - Cheers

    Thursday, May 24, 2012 2:50 PM
  • I like the robocopy option. You don't have to install anything. I created the replica of the folder on a different drive that was totally empty. Then ran robocopy with these params.

    robocopy D:\folder z:\folder /Purge /E /S /R:0 /W:0

    and it ran through it and cleaned it up very nicely.  Thanks ITLouis!

    Unfortunately this didn't work for me.  Robocopy went into another infinite loop copying files over and over.

    Sunday, May 27, 2012 9:28 PM
  • Just had the same problem and the answer provided would have worked after some effort. The problem is that I am lazy so I implemeted this solution. I used Robocopy to copy a blank folder that I had just created over the folder that I had issues with deleting. Basically "robocopy C:\(Blank File) C:\(Problem File) /Purge /E /S /r:0 /w:0" I dont think that the /w:0 is needed but I was frustrated so I threw everything I had at it. The end result was the directories intact but empty..so they could finally be deleted at the root. whew.. Hope this helps. I know it was driving me up the wall..Who needs 15 AppData folders anyhow?
    Tuesday, June 12, 2012 10:06 PM
  • Use CygWin (Linux Emulator for Windows) and use "rm -fR [path]". Work perfectly.
    Thursday, July 05, 2012 11:51 AM
  • next time it happens

    try this

    At a command prompt with elevated level (Start -> type cmd -> rightclick cmd > run as administrator)

    try the following:

    cacls D:\Foldername /T /G Everyone:F
    rmdir /s /q D:\Foldername

     

    This command should delete any folder whatsoever

     

    ceasar,

    CES Free Tech Help

     

    Nope, here's what I get:

    D:\>cacls "D:\Application Data" /T /G Everyone:F
    Are you sure (Y/N)?y
    processed dir: D:\Application Data
    processed dir: D:\Application Data\Application Data
    processed dir: D:\Application Data\Application Data\Application Data
    processed dir: D:\Application Data\Application Data\Application Data\Application
     Data
    processed dir: D:\Application Data\Application Data\Application Data\Application
     Data\Application Data
    processed dir: D:\Application Data\Application Data\Application Data\Application
     Data\Application Data\Application Data
    <-snip->
    processed dir: D:\Application Data\Application Data\Application Data\Application
     Data\Application Data\Application Data\Application Data\Application Data\Applic
    ation Data\Application Data\Application Data\Application Data\Application Data\A
    pplication Data\Application Data
    The data area passed to a system call is too small.

    D:\>rmdir /s /q "D:\Application Data"
    The path D:\Application Data\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC
    ~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLIC~1\APPLI
    C~1\APPLIC~1\APPLIC~1\APPLIC~1\Apps\2.0\Data\CJ1REALM.16N\ZX29EXKD.LK4\ADDIVS~1.
    000\Data\140475~1.100\USER~1.CON is too long.
    <-snip->

    Monday, July 09, 2012 2:10 AM
  • I was needed to move the folder with the Eclipse from my work computer to home, at work, I packed a folder in the zip archive and unpack at home just right where it should have been.
    At the same time if I try to move the already unpacked folder, I get this error.
    Friday, August 03, 2012 11:49 PM
  • http://www.purgeie.com/delinv/index.htm            this small app was able to delete the folders when everything else in this thread failed.  There were 9000+ folders of 'Application Data' in a user folder due to a robocopy.   It allows 3 actions and a 15 day trial, but all I needed was 1 action and about 30 seconds of deletion.  I spent almost 3 hours trying to delete those pesky folders until I found that tool.  Good Luck! 
    Monday, September 10, 2012 8:32 PM
  • All you need to do is to simply drag and drop error encountered files and folders in this tool, and then select the operation you want to perform i.e Move, Rename or Delete. This tool will then automatically execute that particular operation on next boot. 

    Cannot Delete File helped me in this situation.

    Thanks!

    Wednesday, September 19, 2012 2:55 AM
  • Had the same problem, this allowed me to delete it. open command prompt and navigate to the top level directory the folder is located, then type:

    RD /S /Q FOLDERNAMEHERE

    and press enter. this command removes the directory and all the files without prompting you.

    Tuesday, October 16, 2012 12:47 PM
  • At a command prompt, use "dir /x" to get the short name for the directory - then do an RMDIR /s on that.

    THIS ABSOLUTELY WORKS PERFECT. 20 YEARS IN THE BIZ AND I PROMISE THIS WORK IN NANO SECONDS! 

    • Proposed as answer by SKULLYARD Thursday, October 18, 2012 5:59 PM
    • Unproposed as answer by SKULLYARD Thursday, October 18, 2012 5:59 PM
    • Proposed as answer by SKULLYARD Thursday, October 18, 2012 6:00 PM
    Thursday, October 18, 2012 5:59 PM
  • At a command prompt, use "dir /x" to get the short name for the directory - then do an RMDIR /s on that.

    THIS ABSOLUTELY WORKS PERFECT. 20 YEARS IN THE BIZ AND I PROMISE THIS WORK IN NANO SECONDS! 

    I think you should unpropose your contribution as an answer because it does not work at all, as the following sequence of commands will demonstrate:

    cd  /c  c:\
    for  /L  %a  in (1,1,40)  do  md  TestFolder & cd TestFolder
    subst  T:  %CD%
    T:
    for  /L  %a  in (1,1,40)  do  md  TestFolder & cd TestFolder
    cd  /d  c:\
    dir  /x
    (you probably see this 8.3 name: TESTFO~1)
    rd  /s  TESTFO~1

    You will now get a "path too long" error message. By the way - saying that your method works in nanoseconds implies that you have a processor frequency of several Gigahertz . . 

    Thursday, October 18, 2012 6:17 PM
  • Yes!  This did the trick.  I tried all the other options listed here too.

    I had multiple \Application Data\Application Data\.... folders nested.  longpathtool.com may work too.  Don't know who said it was a Trojan but I find that hard to believe.  I've scanned the files I've downloaded and got nothing.  The site doesn't smell fishy either.  If they were pushing an infected file I'd be surprised.

    http://www.purgeie.com/delinv/index.htm worked great!  Unfortunately I used all three of the freebies - one for my original problem and the other two for the failed robocopy cleanup attempts :(

    Friday, October 26, 2012 6:53 AM
    1. I was able to MOVE [Drive]:\[Folder]\[Recursive Folder] to [Drive]:\
    2. I was then able to simply RD [Recursive Folder] /S

    If you're at [Drive]:\[Recursive] and maxed out, you should be able to get to the end of the line and move that endpoint to [Drive]:\[Some Folder] and RD /S it too. Then you should be able to vaporize the recursive folder to oblivion.

    Probably easier.


    • Edited by Teknophage Saturday, November 24, 2012 8:50 PM
    • Proposed as answer by Teknophage Saturday, November 24, 2012 8:51 PM
    Saturday, November 24, 2012 8:50 PM
  • Hey Bhall,

    you can solved this problem by "Long Path Tool" program.

    You please try this I am sure it works.

    Sunday, December 16, 2012 7:47 AM
  • simple solution that worked perfectly for me. thx
    Monday, December 17, 2012 9:01 PM
  • Hi Skullyard, THANKS A MILLION. Your suggestion works. I had tried a few others on the forum but none work. I had like over 300 directories with the same name inbedded. It was taking up lots of space and I keep on getting an error when trying to delete. I know you said to try dir /x but I didn't try that part. I just went to the command prompt and to the c:\ dir and then proceeded with the 2nd part of your instruction which is to rmdir /s directoryname.

    Again, thanks a lot. I normally don't respond to blogs, forum and etc but I wanted someone else to see your suggestion works.

    Thursday, January 03, 2013 8:42 PM
  • A one command solution (pretty much)

    If your problem was caused by clumsy use of the unequalled but also unpolished Robocopy as it seems was the case with most people here (including myself) then I recommend Jason7237's solution as derived from ITLOUIS's; see my recipe of their solution at the bottom, I can find no clear OS command for clearing up these directories.

    If robocopy was the cause of this problem as was in my case you can simply add an exclude parameter to the robocopy command excluding the problem directory (i.e. /XD e:\directory) and make sure to also include the /purge and /e parameters (or the /MIR parameter which appears to be the same). Robocopy can then clean up the mess it created (that YOU and I told it create).

    If robocopy wasn't the cause and you have a version of windows that supports robocopy than you could try making the destination directory of robocopy the problem directory and then use the above parameters.

     

    I like the robocopy option. You don't have to install anything. I created the replica of the folder on a different drive that was totally empty. Then ran robocopy with these params.

    robocopy D:\folder z:\folder /Purge /E /S /R:0 /W:0

    and it ran through it and cleaned it up very nicely.  Thanks ITLouis!

    The following worked for me:

    Where the folder (for example) "C:\myProblemDir" contains nothing but the problem folder structure, enter the following under a 'Command Prompt' running as Administrator.

    MKDIR "C:\myEmptyDir"

    • Creates an empty directory.

    ROBOCOPY "C:\myEmptyDir" "C:\myProblemDir" /PURGE

    • Lets Robocopy recurse/iterate through the problem directories removing them as it goes, by asking it to purge "myProblemDir" against a comparison with "myEmptyDir".

    NB: Prior to finding this solution I had done some other experimentation, including changing the permissions and ownerships. To 'myProblemDir' I recommend a few repetitions of inherited/top-down application/replacement of Permissions ('Full control') and Owner granted to your administrator user.






    • Proposed as answer by Anthony.group7 Saturday, January 19, 2013 8:42 PM
    • Edited by Anthony.group7 Saturday, January 19, 2013 8:53 PM clarification
    Saturday, January 19, 2013 8:41 PM
  • No I haven't, so thank you for the suggestion. I have nothing to test it on at present but I shall bear it in mind. From what I can make out it is a third party utility; I prefer to use built in functionality when it is capable but I acknowledge that this is not always the most efficient method.
    Tuesday, February 05, 2013 8:21 PM