Modify Windows Explorer Command Bar for all folders

Greg Shultz shows you how to modify the Generic registry key to add commands to the Windows Explorer's Command Bar for all the other folders.

In last week's blog, "Use Special Codes to Add Commands to the Windows Explorer Command Bar," I told you about special codes that exist in the registry that you can use to add commands to Microsoft Windows Explorer's context-sensitive Command Bar and showed you where to find them. I then demonstrated how to add those special codes to a set of keys in the Registry for the different Library folders.

I also told you there is a key in the registry called Generic for all the other folders that do not appear in any of the Libraries. I then explained that to add commands to the Windows Explorer Command Bars for all the other folders that do not appear in any of the Libraries, you'll have to do a bit more work. In short, you'll have to change the ownership and permissions on the key and then add the TasksItemsSelected and the TasksNoItemsSelected keys manually, before you can add the codes.

In this edition of the Windows Desktop Report, I'll show you how to modify the Generic registry key to add commands to the Windows Explorer's Command Bar for all the other folders.

This blog post is also available in PDF format in a TechRepublic download and as a TechRepublic Photo Gallery.

Editing the Registry

It is important to keep in mind that the Windows Registry file is vital to the operating system and changing it can be dangerous if you inadvertently make a mistake. As such, you should take a few moments to back up your system by creating a system image in the Backup and Restore tool. That way if anything goes awry, you can restore your system and get right back to work.

To launch the Registry Editor, click the Start button, type Regedit in the Start Menu's Search box, and press [Enter]. When the UAC dialog box appears, respond appropriately.

The Command Store

Don't forget that the CommandStore key in the registry contains the codes that are the source of the commands that appear on Windows Explorer's context-sensitive Command Bar. From within the Registry Editor, navigate to the following folder:


When you select shell, you'll see all the codes that you can use to customize Windows Explorer's context-sensitive Command Bar. Keep in mind that while each of these keys contains subkeys and other details, you need be concerned only with the names in the shell key. For example, to add the Delete command, all you need to know is the code Windows.delete.

Stay on top of the latest Microsoft Windows tips and tricks with TechRepublic's Windows Desktop newsletter, delivered every Monday and Thursday. Automatically sign up today!

Changing the permissions

Once the Registry Editor appears, navigate to the following folder


When you do, you'll see that while the key is technically named {5c4f28b5-f869-4e84-8e60-f11db97c5cc7}, its CanonicalName is Generic (Figure A), which I'll use from here on out to refer to it. You'll also notice that the Generic key does not contain the TasksItemsSelected and the TasksNoItemsSelected keys by default. As I said, you will have to add them manually.

Figure A

The CanonicalName is Generic.
However, before you can do so, you will have to change the permissions of the Generic key. To begin, right-click on the Generic key and select the Permissions command. When you see the Permissions For dialog box, as shown in Figure B, immediately select the Advanced button to bring up the Advance Security Settings dialog box.

Figure B

When you see the Permissions For dialog box, select the Advanced button.
Now, select the Owner tab, choose Administrators from the Current Owner To panel, and click Apply. Once the Current owner is set to Administrators, as shown in Figure C, click OK to continue.

Figure C

You will need to change owner to the Administrators group.
When you return to the Permissions dialog box, choose Administrators in the Group or User Names panel and then select the Full Control check box in the Permissions panel, as shown in Figure D. Click OK to continue.

Figure D

You must set the Permissions for Administrators to Full Control so that you can make changes to the Generic key.

Editing the Generic key

Now that you have full control of the Generic key, you are ready to begin editing. To get started, right-click {5c4f28b5-f869-4e84-8e60-f11db97c5cc7} and select the New | Key command. When the new key appears, name it TasksItemsSelected. Then, choose the New | Key command again and create the TasksNoItemsSelected key. At this point, your Generic key should look like the one shown in Figure E.

Figure E

Once you finish this step, you should see both the TasksItemsSelected and the TasksNoItemsSelected keys inside the Generic key.

At this point, I'll reuse the list of codes that I chose for last week's article:

  • Windows.delete
  • Windows.navpane
  • Windows.previewpane
  • Windows.menubar

Since the Windows.delete code requires an item to be selected, it will be added to the TasksItemsSelected key. The Windows.navpane, Windows.previewpane, and Windows.menubar codes do not require an item to be selected, so they will go in the TasksNoItemsSelected key.

As you can see, the TasksItemsSelected key contains only the String Value titled Default, which is where we'll put the Windows.delete code. Double-click the Default icon to access the Edit String dialog box. Then type the Windows.delete code in the text box, as shown in Figure F.

Figure F

Just type the Windows.delete code in the text box.
Now, access the TasksNoItemsSelected key, double-click the Default icon, and add the Windows.navpane, Windows.previewpane, and Windows.menubar codes in the text box, as shown in Figure G. Be sure to use semicolons to separate each command.

Figure G

Be sure to use semicolons to separate each command.
At this point, close the Registry Editor and launch Windows Explorer. When you do, you'll see the new commands on the Command Bar in Windows Explorer when you access any folder, as shown in Figure H.

Figure H

Your new commands now appear on the Command Bar in Windows Explorer for folders that do not appear in any of the Libraries.

What's your take?

Have you wanted to be able to customize the Command bar in Windows 7's Windows Explorer? Will you employ this technique to customize the Command bar? As always, if you have comments or information to share about this topic, please take a moment to drop by the TechRepublic Community Forums and let us hear from you.


Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.


This is a great hack. I realize that this comment is little late, as the Schultz article was published a year ago today. But I am interested to learn whether there is a similar registry edit that would allow commands to be added when viewing user created libraries with Explorer. ---Ed


I received a message that said, Access Denied when trying to change permissions to this Key.


I hope someone is still reading this because I just noticed something I think is very strange. I added delete to the context menu for the specific libraries and for generic. When I go into explorer and click on documents under libraries and select a file, delete shows up in the context menu. If, however, I go to My Documents under my username (same location, it???s the only thing checked in the documents library) and select a file, no delete in the context meun. If I go to C:\users\username\ and select My Documents, the context menu shows delete. Anything under that does not. Same for music pictures and videos. Other folders under username show delete when selected and those do as long as I navigate to them from libraries. Anyone else seen this behavior and know what changes I need to make to get the context menu to work for them too? Thanks Howard


This is great and all, and quite helpful since apparently my habit of selecting file or folders then going to the tool bar and clicking the red x to delete them is very ingrained, but I miss the red icon. I mean come one, it???s a visual operating system and they change the context menu, get rid of hte visual component and go with just text? What were they? Thinking? So, if anyone knows how to put little icons beside the menu items or completely replace the text with icons, that would be really cool. H


I still have XP at home and at work. What I want is for Explorer to come up with the list of folders panes all of the time, instead of when specifically asked for by clicking the folders button. So much faster to find the subdirectory that way instead of clicking your way through, and to go back up just select where you want to go and go, none of the "breadcrumbs" navigation needed.


This has not worked even after going though registry 3 times to verify all settings are correct.


I work at Laplink, just a mile or so from Microsoft main campus, it's exciting to be so close to a juggernaut!

Mark W. Kaelin
Mark W. Kaelin

Have you modified the Windows Explorer Command Bar using the codes? How is it working for you?


If what you are looking for in XP is what you get when you right click on something, like "My Documents" and select explore instead of the view you get from just double clicking there is a way to do that. You go into tools - options and set the default for folders to explore instead of open. Then double clicking will open up with the tree view every time. You can find specific instructions for it on the web.


I don't know if its the same problem you are having but when I set it up the first time it didn't work for me either. three things I noticed. A white space at the end of the text will cause it not to work, Capitolization is important, and whether the folder is in a library is important. you have to make the same settings for documents, videos, music, etc and for the generic type to see it in all of them.

Editor's Picks