I couldn't delete a set of files on an old Windows OS because "The file name is too long". After fruitless Google searching, I found the solution and so, am posting here for posterity.
- Remove any files you don't want to delete (and whose name is short enough to allow this!).
- Ensure recursive write access in the containing file directory and all parent directories.
- Starting at the root directory, rename it to a single character, for example 'a'.
- Do this for each successive sub-directory, marching towards the one containing the files you want to delete. So you might go from a path like this:
C:\some\long\windows\path\to\files\you\cannot\delete
to a new path like this:
C:\a\a\a\a\a\a\a\a\a
- Now, try deleting the files. If it still doesn't work trying renaming the files themselves and then deleting.
This ended up working for me when nothing else would.
Good luck!
AWESOME!!! This made my day!
Posted by: R | January 17, 2010 at 02:09 AM
Glad to help. Can't tell you how many times ramdom posts like this have saved mine!
Posted by: Ben | February 03, 2010 at 12:45 AM