Welcome to MSDN Blogs Sign in | Join | Help

Why can't you rename the Recycle Bin?

Commenter zd asks, "Why can't you rename the Recycle Bin?"

This question, as do many questions, comes with implicit assumptions. In particular, the assumption that everything can be renamed by default and that somebody must have gone to the effort of blocking the rename of the Recycle Bin.

Actually, reality is the reverse. Shell namespace objects cannot be renamed by default. Code has to be written to support rename. This is a special case of something Ry Jones saved, namely, that features start out nonexistent and somebody has to make them happen.

To support renaming, the shell folder needs to support IShellFolder::SetNameOf and then needs to find a place to save that new name so that the next time somebody calls IShellFolder::GetDisplayNameOf, the name you set is returned instead of the original name. Other technical points are making sure that shortcuts that were created to the object before the rename still work after the rename, and that you didn't break any code that tried to access the object by its old name. That last bit is scary, because third-party programs have a habit of hard-coding all sorts of stuff. (I can imagine there's some program that looks for an object called "Recycle Bin" and crashes if it can't find it.)

Besides, you can't rename Control Panel icons either.

Published Monday, March 17, 2008 7:00 AM by oldnewthing
Filed under:

Comments

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 11:14 AM by SvenGroot

If there are any programs that look for an object named "Recycle Bin" they'd fail on localised versions of Windows too. While I use an English version, many people I know use localised versions and to the best of my knowledge such a program hasn't been encountered yet, fortunately.

And at least on Vista, you *can* rename the Recycle Bin.

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 11:20 AM by Brian

The fact it's renamed in localized versions of windows implies it is renameable -- just not through the standard "F2" interface.

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 11:20 AM by MadQ

Besides, if you really want a "Teh Trash" icon on your desktop instead, you can always create a shortcut, which can be renamed. Nitpicks: And configure the desktop not to show the Recycle Bin. And use TweakUI to remove the shortcut icon overlay, if that bugs you.

Ditto for Control Panel icons.

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 12:01 PM by Lars

It can be renamed by editing the registry. A quick google search reveals plenty of pages with information on how to do it.

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 12:08 PM by JM

@Brian: Not exactly. Adjusting a localization string which will stay the same for the entire lifetime of the system is not the same thing as allowing users to assign a new name on the fly.

If I were Raymond, I'd probably have formulated that much snappier and ended it with "I can't believe I had to write that", but I'm not.

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 12:13 PM by Tim

@SvenGroot:

"While I use an English version, many people I know use localised versions and to the best of my knowledge such a program hasn't been encountered yet, fortunately."

It's not beyond the bounds of possibility:

http://technet.microsoft.com/en-us/magazine/cc160898.aspx

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 1:08 PM by John Topley

I remember that when Windows 95 came out, one of the first Registry tweaks I ever came across was the one that let you change the display name of the Recycle Bin. And then later on there was another one that added the Rename context menu item (as if you'd want to rename it that frequently to justify the menu item!)

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 1:11 PM by DCMonkey

As Sven mentioned, you can rename the Recycle Bin in Vista by the standard methods (right click -> Rename, single click on text label, F2)

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 2:01 PM by Xepol

In other words, it is a fundamental design flaw that made it harder to implement the feature than to not.

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 3:32 PM by CGomez

"In other words, it is a fundamental design flaw that made it harder to implement the feature than to not."

Hahahahaha.  That would imply that all software starts out with the ability to do anything, and only a fundamental design flaw keeps you from implementing features.

No.  Software starts out as nothing.  Everything else must be implemented.  Things do not for many reasons... like simply not getting around to doing it.

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 4:38 PM by /df

So, if the EditFlags are set to enable the Rename context menu item for the Tr^H^HRecycle Bin, is there in fact anything in Windows that doesn't work when you rename it?

(There didn't seem to be in 98SE).

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 5:09 PM by Paul Betts

I usually name my Recycle Bin "Digital Purgatory"

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 6:20 PM by mr kwesjun

Doesn't renaming the bin also involve changing strings like 'Are you sure you want to move this file to the recycle bin?', or does it actually

format the string already using the correct name obtained through the namespace (perhaps by GUID)?

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 8:00 PM by Dean Harding

kwesjun: That's easy to test. I just renamed the Recycle Bin on Vista, deleted a file and it still asked me whether I wanted to move the file to the "Recycle Bin".

So no, changing the name of the Recycle Bin does not also modify those strings.

# re: Why can't you rename the Recycle Bin?

Monday, March 17, 2008 8:30 PM by Miles Archer

This is a unix phenomenon. Everything is a file, so of course you can use file type operations on it. So, if you can't it must have been removed for a reason.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 1:52 AM by Paradice

"In other words, it is a fundamental design flaw that made it harder to implement the feature than to not."

You're an idiot.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 3:08 AM by Riyaz Ahemed

I do it by navigating here:

HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\ShellFolder

and by changing the DWORD value of Attributes to FF 01 00 20. Refresh the Registry and the Desktop and lo, you a have all the options of Cut, Copy, Delete and Rename on the Right Click Context Menu of the Recycle Bin.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 6:19 AM by noone in particular

@Paradise:

How do you reach this somewhat surprising conclusion?

Just by observing how Xepol did not limit his thinking to the confines of Windows and MSDN?

ShellObjects can be renamed. Recycle Bin is a shell object. It either can be renamed or Xepol is right.

YOUR event horizon may be windows. Other people see other OS and notice the flaws of windows.

And we are here to have Raymond explain these flaws, and how they can not be undone, because Microsoft fears to break 1000000 wrongly done implementations of "Hello World"

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 6:57 AM by #

>> YOUR event horizon may be windows. Other people see other OS and notice the flaws of windows.

You cannot rename the proc filesystem in unix either.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 7:27 AM by Michiel

Of course renaming "Recycle Bin" cannot change strings like "Are you sure you want to move this file to the recycle bin?". These sentences must exist independently, as they will be localized independently. You just cannot translate the "to the %ls" part.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 8:20 AM by Gabe

Miles Archer: The fundamental file operations are open-read-write-close. Renaming a file is actually a directory operation. Things like network sockets and pipes behave like files (you can open/close, read/write them), but renaming them doesn't make sense.

Of course there are things like /dev/null which technically you can rename, but things would break horribly if you did.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 8:32 AM by Bill P. Godfrey

When reading the codeproject emails, I occasionally see aricles something along the lines of "How to rename the start button programmaticaly".

http://www.codeproject.com/KB/cs/StartButtonRenamer.aspx

I'm afraid my tidy little brain can't comprehend the need to rename the start button so often that it's worth automating.

It looks pretty cool though.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 8:33 AM by SCB

"by changing the DWORD value of Attributes to FF 01 00 20. Refresh the Registry and the Desktop and lo, you a have all the options of Cut, Copy, Delete and Rename on the Right Click Context Menu of the Recycle Bin."

So if you delete the Recycle Bin, where does it go?

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 9:03 AM by Dean Harding

"ShellObjects can be renamed. Recycle Bin is a shell object. It either can be renamed or Xepol is right."

Way to prove, yet again, that people don't read the blog post before posting comments.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 9:48 AM by mr kwesjun

@Dean Harding: So it shouldn't be renamed then, especially on shared desktops it'd just be needlessly confusing.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 10:59 AM by SuperKoko

Raymond wrote:

"

I can imagine there's some program that looks for an object called "Recycle Bin" and crashes if it can't find it.

"

Do you mean, something like that?

http://blogs.msdn.com/oldnewthing/archive/2007/03/13/1868542.aspx

At least, this program would never have worked in localized Windows.

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 11:19 AM by Dave

Of course, the question that was really being asked and that Raymond failed to answer was (probably) something like:

Since you can rename all the other standard desktop icons (My Computer, Network Neighbourhood/My Network Places, My Documents, The Internet, etc), why was the decision made that the Recycle Bin should not be renameable?

Obviously someone/a group of someones made the effort to make the other icons renamable, so why not the Recycle Bin? Why is it special? Was it simply a time issue (which persisted until Vista due to the fear of breaking things)?

# re: Why can't you rename the Recycle Bin?

Tuesday, March 18, 2008 11:41 PM by Stephen Jones

Just as a matter of interest how do I get the Recycle bin back to the desktop after I deleted it.

# re: Why can't you rename the Recycle Bin?

Wednesday, March 19, 2008 3:18 AM by Riyaz Ahemed

@Stephen Jones

@SCB

To get back the Recycle Bin on the Desktop flare up the Registry Editor, navigate to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\

Right click NameSpace and New >> Key. Name the key to {645FF040-5081-101B-9F08-00AA002F954E}.

Refresh the Registry Editor and the Desktop.

I assume that when u delete the Recycle bin itself, just the Namespace Entry from the above key is deleted. U can still delete other files and folders even though the Recycle Bin has been deleted.

# re: Why couldn't this interface be implemented by default for all shell objects?

Thursday, March 20, 2008 4:35 PM by Mike Smith-Lonergan

@Raymond: I'm sure this would make sense if I understood more about Interfaces, so be kind to this poor dolt...

Why wouldn't it be possible/practical to implement this Interface on all shell objects e.g. Implement it on the parent class from which all shell objects derive (if there is such a thing)?

# re: Why can't you rename the Recycle Bin?

Thursday, March 20, 2008 7:22 PM by SuperKoko

"Implement it on the parent class from which all shell objects derive (if there is such a thing)?"

Firstly, COM objects don't directly support inheritance.

But, the main issue is that, different shell objects have different behaviors for renaming.

Renaming a file system object renames the file on disk.

Renaming a drive letter object changes the disk label.

Renaming "My Documents" will change a registry base key.

Some of the code written for "My Documents", "My Computer" and "Network Neighboorhood" could probably be re-used, since their naming behavior is pretty similar.

New Comments to this post are disabled
 
Page view tracker