Tuesday, December 01, 2009

Can't Delete a Folder in Windows 7 [u]

I've been using Windows 7 for almost a year now. There are certain problems in Windows 7 that seem so ridiculous that they're almost unbelievable (like being unable to login to Windows 7 with your profile on occasion because the profile service is not ready). But, here's a whopper! 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.

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. I posted my issue on the Microsoft TechNet forums.  Anyone else figure out a way around this?

UPDATE (12/3/09): It turns out that for some reason, I had many many levels of nested folders that somehow got created during a backup. 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. The removal process took a couple of hours and made my eyes sting. Ugh!

6 comments:

  1. Just guessing here, but try opening a command window and deleting the files using their short file names (i.e. c:\DOCUMEN~1\USERS\BHALL\ACROFN~0.LST).

    ReplyDelete
  2. I tried "rmdir D:\Can'tDelete /S" but it said, "The file name is too long." What's the short name of D:\Can'tDelete?

    ReplyDelete
  3. What is happening is that your robocopy script is getting hung in a loop becuase of junction points. You need to run ith with the /XJ command.
    I am still looking for a good way to delete when this happens though.
    JustusIV

    ReplyDelete
  4. Hi, I have your same promblem with a file, and I´ve tried everything other posts said, but the only thing that seems to work is to delete piece by piece a lot of appdata, as you said...but this is a really frustrating process...so I´m asking now...did u find any other solution since you posted this one?

    ReplyDelete
  5. JustusIV,

    Thanks for the tip on robocopy. I was not sure how this screwed up mess was created in the first place. Still looking for an easy way to delete this crap. My attempt to write a VBScript to drill down to the bottom and start deleting in reverse crashes before it gets to the bottom.

    Dan

    ReplyDelete
  6. I had the similar problem and faced it a lot of times. I often solve this type of problems using "Long Path Tool". It helped me in solving this error and all related errors.

    ReplyDelete