1

I ended up with a folder that cannot be deleted. The issue started out as Windows 7 complained about a deletion I performed in an old recyclebin with a message 'filename too long 434 instead of 256 characters' (or something very similar). I tried lots of things like those mentioned in this very similar question: Renaming/deleting impossible filenames in Windows 7

But I did not succeed. I succeeded in renaming and removing lots of subfolders but not all of them. This is what's left visibly, a folder from the recyclebin:

C:\RECYCLER\S-1-5-21-842925246-2025429265-682008880-1013\

Inside this folder is another one named com4 but that is only visible to a tool like Total-Commander. I was not able to display this folder com4 by say:

dir *.* /A:s
dir *.* /A:h

I find interesting that apparently something is in there because the following command results in: access denied. So Windows 7 recognizes an object but does not reveal or delete it.

rd "\\c:\RECYCLER\S-1-5-21-842925246-2025429265-682008880-1013\com4\

Even though I am using an elevated command prompt and logged in as admin without any limitations (I assume).

Any ideas how to get rid of this folder named com4? Getting rid of anything below c:\RECYCLER is fine as well.

snahl
  • 159
  • 1
  • 1
  • 13
  • duplicates: [How to delete a file with a path too long to be deleted](https://superuser.com/q/755298/241386), [How to delete a file in Windows with a too long filename?](https://superuser.com/q/45697/241386), [Force delete files with a rather large name](https://superuser.com/q/718223/241386), [How do I delete a folder which is nested quite deep and avoid “File name too long”?](https://superuser.com/q/256105/241386)... – phuclv Feb 28 '20 at 02:49
  • The answer by @hectorpal works in that link you (@phuclv) provided. – snahl Feb 29 '20 at 23:15
  • The solution I have applied was to connect and mount the disk containing the over-long filename to Raspberry PI running Raspbian (Debian). From there I was able to delete that folder in question. – snahl Feb 29 '20 at 23:18

2 Answers2

1

To deal with the too long of a path/filename you can shorten the names of the folders until the path/file gets short enough to delete.

Even so it looks like you have another problem. Windows can't delete some files names that get created(com4 in your case). You can try deleting these from Linux, or possibly some software other than Windows Explorer to delete it.

In addition, in Windows and DOS utilities, some words are also reserved and cannot be used as filenames.[17] For example, DOS device files:[19]

CON, PRN, AUX, CLOCK$, NUL COM1, COM2, COM3, COM4 LPT1, LPT2, LPT3, LPT4 (LPT4 only in some versions of DR-DOS) LST (only in 86-DOS and DOS 1.xx) KEYBD$, SCREEN$ (only in multitasking MS-DOS 4.0) $IDLE$ (only in Concurrent DOS 386, Multiuser DOS and DR DOS 5.0 and higher) CONFIG$ (only in MS-DOS 7.0-8.0)

https://en.wikipedia.org/wiki/Filename

Note: I've seen some similar problems that can get fixed by using the 8.3/MSDOS versions of the filenames.

dir /X (that's a capital X.)

This command will show the the filenames in 8.3/MSDOS.

There's more information about this on the page linked to in the description: Renaming/deleting impossible filenames in Windows 7

Bryan Ritter
  • 326
  • 2
  • 5
0

You can install "Unlocker"

Check this website http://www.thewindowsclub.com/how-to-delete-undeletable-folders-in-windows

or

you can look into Microsoft website... social.technet.microsoft.com/Forums/windows/en-US/00493939-079c-481b-9999-a82ac680dcab/cant-delete-folder-destination-path-too-long-error-in-windows-7

BruceWayne
  • 101
  • 2
  • OP mentioned that the files are hidden and he had to use special tools Total-Commander. I know **unlocker** is some serious stuff but i don't think it would of much help in OP's situation – clhy Nov 09 '15 at 04:28
  • He can unhide those from folder options, no need to worry about it – BruceWayne Nov 09 '15 at 04:30
  • EHh so easy.... also the second link you posted is not formatted properly and is broken – clhy Nov 09 '15 at 04:34
  • Sorry..now its fixed – BruceWayne Nov 09 '15 at 04:38
  • Nope. Unlocker didn't do it. `com4` happily sits there. Somehow I got past ` com4` and there were lots folders named `HHH...HHH` (lenght: 81 H) nested deeply. Those I was able to rename each to `NN`. This way at least the overall length of that biest shortened. Again with Total-Commander I was able to step backwards (`cd..`) untill I got near `com4`. There Total-Commander listed a folder as `...` (3 dots). Clicking on that one took me to `C:\RECYCLER\S-1-5-21-842925246-2025429265-682008880-1013\`. In other words it jumped at least 2 folder levels backwards towards the root. An MFT editor? – snahl Nov 09 '15 at 22:33