homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft Windows OS (XP/NT/Vista/Windows 7/8/9)
Forum Library, Charter, Moderators: bill

Microsoft Windows OS (XP/NT/Vista/Windows 7/8/9) Forum

file whose path is too long for the Recycle Bin
I want to find the file and rename it
Robert Charlton

 8:42 am on Mar 28, 2008 (gmt 0)

On a Windows XP machine... for simple on-computer data backups, I have a second hard-drive on my machine and routinely copy over my working data to a new folder on it and then delete the old.

Each time I delete the old, though, I trip over one file (I'm guessing one, anyway) whose path, I assume, is too long, and I get a message to the effect that Windows cannot delete "items whose name is too long for the Recycle Bin. Do you want to permanently delete it?" Pain.

I click "yes to all" and everything is fine, but I've got to keep an eye on things and do this manually, every time. I'd like to find the d**** file and rename it, but haven't figured out how to do it.

I should mention that I've already set the target for "My Documents" to a very short name... in my case d:\mydocs\

I'm guessing that this problem is due to probably one file that was automatically named by some app. I'm just trying to locate it. I think Total Commander will rename or delete it after that. If not, I'll need to come back for more advice.

Any thoughts for finding it, somewhere among a great many folders, in some automated way?



 9:48 am on Mar 28, 2008 (gmt 0)

i don't think the length of directory name matters.
i'm going to guess you are hitting a windows kernel limit - maybe 255 or so?
try doing a windows file name search for all files with more than 255 characters using filename wildcarding:
?...(for a total of 255 consecutive question marks)...?*

Receptional Andy

 9:59 am on Mar 28, 2008 (gmt 0)

If you use a file search that supports regex you specify how many characters to using quantifiers, e.g. {255,} for 255 characters or more.


 10:34 am on Mar 28, 2008 (gmt 0)

just to be clear i was referring to the regular windows start/search "feature" which is far too simple to support regex.


 12:35 pm on Mar 28, 2008 (gmt 0)

The maximum length of a filename in Windows is 260 (including the drive letter, full directory path, etc). This limit can be exceeded by unicode versions of various API functions.

Try chkdsk.exe - its a standard Windows component that can be run from cmd.exe. You may need to use an extra switch or two, I'm not sure.


Robert Charlton

 6:52 pm on Mar 28, 2008 (gmt 0)

Whether 255 or 260, yes, I'm sure that's what's triggering the message. I'd even be happy to locate everything over 240 (just in case the length is temperature sensitive. ;) )

try doing a windows file name search for all files with more than 255 characters using filename wildcarding:
?...(for a total of 255 consecutive question marks)...?*

Intriguing idea... worth a shot.

I don't offhand understand how I'd use chkdsk.exe to find a long file.

Robert Charlton

 4:29 am on Mar 29, 2008 (gmt 0)

It turns out that the Recycle Bin has a shorter length limitation than the Windows kernel limit. I couldn't find anything with 255 characters, so I kept nibbling down until I jumped down to 100 question marks and came up with one folder, which I've renamed to something much shorter. I should have tried deleting the backup first, but I'll know soon enough if that was it, when I next delete \mydocs-BU\.

The long name, incidentally, came from a test in which I'd used IE to save a client's original home page to disk, and it named the folder for the original home page title... probably 150 characters long. ;)

I'd never noticed the folder name because the display was truncated and buried in a project subfolder.

[edited by: Robert_Charlton at 4:31 am (utc) on Mar. 29, 2008]

Robert Charlton

 7:40 pm on Mar 30, 2008 (gmt 0)

PS - Deleting the old backup folder last night worked without a glitch. Thanks.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Microsoft / Microsoft Windows OS (XP/NT/Vista/Windows 7/8/9)
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved