Windows

Add the Up button to the Explorer Command Bar in Windows 7

In this edition of the Windows Desktop Report, Greg Shultz tells you to put the Up button on the Command Bar via a little known keyboard shortcut, a short VBScript, and some registry edits.

In last week's blog post, "Why Breadcrumb Navigation Is Better than the Up Button," I told you that if after reading that post you still were not convinced that the breadcrumb navigation system was better than the Up button, I would show you how to add the Up button to the Windows Explorer Command Bar in Windows 7.

As I mentioned last week, after spending some time researching the idea, I did indeed find a way to put the Up button on the Command Bar via a little-known keyboard shortcut, a short VBScript, and some registry edits.

In this edition of the Windows Desktop Report, I will tell you about the keyboard shortcut, provide you with the short VBScript, and show you how to edit the registry to add an Up button to the Command Bar in Windows Explorer.

This blog post is also available in PDF format in a TechRepublic download.

Caveats

The edit that you'll use to add the VBScript to the registry involves the same registry keys that I showed you in the "Modify Windows Explorer Command Bar for All Folders" blog post. And, unfortunately, the way that the Windows 7 registry is set up for the context-sensitive Command Bar, the two techniques are incompatible with each other. In other words, you can use only one of these techniques.

If you have not previously added any commands to the Command Bar via that article, then you can skip to the next section. However, please be sure and read through this entire article before you make any changes to the registry. There are a few other twists that you may want to consider before making the suggested changes.

If you have added commands to the Command Bar via the "Modify Windows Explorer Command Bar for All Folders" blog post, the Up button will not show up after you follow the steps unless you undo the changes that you made to the registry.

More specifically, you have to remove all the special codes that you added to the TasksItemsSelected key, such as the Windows.delete code, and all the special codes that you added to the TasksNoItemsSelected key, such as the Windows.menubar code, and then you can add and use the Up button on Windows Explorer's Command Bar.

When removing the codes, be sure that you remove only those that you added. Do not remove any of the default codes. Again, please make sure that you read through this entire blog post before you make any changes to the registry. There are a few other twists that you may want to consider before making the suggested changes.

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!

The Up functionality

Even though Microsoft removed the Up button from the Windows Explorer Command Bar, it did not remove the functionality from the operating system. In fact there are two ways that you can access and use the Up functionality in Windows Explorer -- a keyboard shortcut and a menu item.

When you are in Windows Explorer and want to go up one folder, you can use the keyboard shortcut [Alt]+Up Arrow. You can also access the menu bar, pull down the View menu, select the Go To menu, and choose the Up One Level command.

Using either of these techniques as an Up button replacement will work just fine, but they are not as convenient as having an Up button on the Command Bar.

Since the [Alt]+Up Arrow keyboard shortcut is basically present whenever Windows Explorer is on-screen, it lends itself quite handily to being automated in VBScript.

The VBScript

VBScript has essentially been superseded by PowerShell as the tool of choice for automating tasks in the Windows operating system. However, VBScript still has plenty of tricks up its sleeves. One such trick is the little-used ability to automate keystrokes via the SendKeys method.

To send keystrokes, the SendKeys method uses certain characters to represent special keys on the keyboard. For example, to send the [Alt]+Up Arrow shortcut, the SendKeys method uses the characters %{UP}. Since sending the keystroke is the main thing that the script must accomplish, the entire script is only three lines:
Set WshShell = WScript.CreateObject("WScript.Shell")

 

WshShell.SendKeys "%{UP}"

 

Wscript.Quit

The first line activates all the features of the Windows Script Host object model by linking the WshShell variable and the Wscript object together, which ultimately provides you with direct access to the Windows Shell. The second line sends the keystroke via the SendKeys method. The third line uses the Quit method to terminate the script.

To create this script, launch Notepad and type or copy the lines shown above. When you've finished, save the file as Up.vbs in a folder off the root directory. For example, I created a folder called Scripts in the root of the C: drive.

Getting a GUID

Many of the key names in the registry are actually Globally Unique Identifiers (GUIDs). A GUID is a 128-bit integer that is considered statistically unique. If you look closely at a GUID, you'll see that it is represented as a hyphenated string that contains a series of lower or upper case hexadecimal digits in groups of 8, 4, 4, 4, and 12.

In order to add the Up button to Windows Explorer's Command Bar via the registry, you will need two GUIDs.

You can instantly create a GUID by visiting the Create a GUID web site. As soon as you hit the site, you will receive a GUID. Just copy the GUID, paste it into Notepad, and save it. To get a second GUID, just refresh the page and then copy and paste the GUID into Notepad.

Once you have the GUIDs in Notepad, enclose each one in curly brackets {}, as shown in Figure A.

Figure A

Once you paste your GUIDs in Notepad, enclose each one in curly brackets {}.

You'll need both GUIDs in a moment, so just minimize Notepad for now.

Editing the registry

It is important to keep in mind that the registry 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 Restore Point as well as 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 Search box, and press [Enter]. When the UAC dialog box appears, respond appropriately.

Changing the permissions

Once the Registry Editor appears, navigate to the following folder:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}

When you do, you'll see that this GUID key has a CanonicalName of Generic, as shown in Figure B. From here on out I'll refer to this key as the Generic key.

Figure B

While the key is technically named {5c4f28b5-f869-4e84-8e60-f11db97c5cc7}, its CanonicalName is Generic.

At this point, pull down the Favorites menu and select the Add to Favorites command. Doing so will make it easy to get back to the Generic key.

Before you can edit the Generic key, you will have to change its permissions. To do so, right-click the Generic key and select the Permissions command. When you see the Permissions For dialog box, as shown in Figure C, select the Advanced button to bring up the Advanced Security Settings dialog box.

Figure C

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

Figure D

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

Figure E

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 F.

Figure F

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

In order for the Up button to be present at all times, you'll edit both the TasksItemsSelected and TasksNoItemsSelected keys. More specifically, you'll be adding a series of keys and values to each.

To begin, right-click on TasksItemsSelected and select the New | Key command. When the new key appears, name it 0 (zero). Now, access your Notepad file containing the GUIDs you created earlier and copy one of the GUIDs to the clipboard. Now, right-click the 0 key and select the New | Key command again. When the new key appears, paste the GUID in as the key name. When you do, your registry will look similar to the one shown in Figure G.

Figure G

When the new key appears, paste the GUID in as its name.
Now, you will add two string values to the new GUID key that will form the title of the new button as well as the pop-up that will appear when you hover over the button. Right-click the GUID key and select the New | String Value command. When the new value appears, name it InfoTip. Right-click the GUID key again, select the New | String Value command, and then name this value Title. To continue, double-click the InfoTip value and type Go Up one level in the Value Data text box, as shown in Figure H. Then double-click the Title value and type Up in the Value Data text box.

Figure H

The InfoTip will appear in the pop-up when you hover over the button.
Now you will add a succession of three keys below the GUID key that will ultimately reference the Up.vbs script that you created earlier. To do begin, right-click the GUID key and select the New | Key command. When the new key appears, name it shell. Next, right-click the shell key and create a new key below it called InvokeTask. Then, right-click the InvokeTask key and create a new key below it called command. When you do, your registry will look similar to the one shown in Figure I.

Figure I

When you create the three keys below the GUID key, your registry should look like this.
Now, inside the command key, double-click the Default string value and type the command wscript.exe followed by the path to the Up.vbs script you created and saved earlier. For example, I saved my Up.vbs script in the C:Scripts folder, so my Edit String dialog box looks like the one shown in Figure J.

Figure J

Type the command to launch the VBScript in the Value Data text box.
At this point, you'll repeat this series of steps using the other GUID to create an identical structure under the TasksNoItemsSelected key. When you do, your registry will look like the one shown in Figure K.

Figure K

You then add an identical structure under the TasksNoItemsSelected key.

At this point, you can close the Registry Editor.

Using the Up button

As soon as you make these changes to the registry, they will be in effect, so go ahead and launch Windows Explorer. Now, it is important to understand that the Up button will NOT appear in Windows Explorer if you go directly to any Libraries. So if you want to use the Up button, you must avoid going directly to the Libraries, as shown in Figure L.

Figure L

The Up button will not appear if you go to the Libraries.
However, if you point Windows Explorer to C: and tunnel into the User folder, as shown in Figure M, the Up button will appear and function just like the Up button in Windows XP. However, unlike the one in Windows XP, there is no icon associated with the Up button. Due to the context-sensitive nature of the Command Bar in Windows 7, icons are not allowed. Also because of the context-sensitive nature, the Up button will not always be in the same position. It will shift to the right or the left as other buttons are added or removed from the Command Bar.

One more thing to keep in mind is that the Up button will not appear in My Documents, My Music, My Pictures, or My Videos until you make a change to those folders' properties. Doing so will make these folders work like they did in Windows XP.

Figure M

If you start in the Root directory of drive C, the Up button will appear in Windows Explorer.
For example, in order for the Up button to appear in My Documents, right-click on it and select the Properties command. When the My Documents Properties dialog box appears, select the Customize tab. Then, select General Items in the Optimize This Folder For drop-down menu. Next, select the Also Apply This Template to All Subfolders check box, as shown in Figure N. Then, click OK.

Figure N

Select General Items from the drop-down menu and select the check box.

You'll need to make the same changes to the My Music, My Pictures, and My Videos folders in order for the Up button to appear in Windows Explorer when you access them.

What's your take?

Are you one of those folks who miss the Up button? Will you employ this technique to add the Up button to 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.

About

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.

16 comments
vivtech
vivtech

When you save/open in Office 2013 the Up button isn't there.... is there an extra step to achieve this?

bg3075
bg3075

I tried the suggestion, exactly as written. It didn't work. Is it due to my Windows 7 being 64-bit install?

garywainright
garywainright

I followed the instructions above but am not able to get "Up" to appear in My Documents, My Music, My Pictures or My Videos. Was something left out of the instructions?

JimInNM
JimInNM

These tips are great in my opinion but some of us are terrified of editing the registry, especially when threre are numerous steps. It would be nice if you could also include a link or file that does this for us if we choose to select that option rather than doing it manually. Scared, not lazy.

skooboy
skooboy

Sometimes I'll try these articles just to learn more about an OS's innards, but an "up" button in Windows Explorer? What for? Who cares? Like others pointed out, just click the level you want in the command line.

d_g_l_s
d_g_l_s

in an even better format with better and faster capabilities. In the Windows 7 Address Bar at the top of Explorer all one has to do is click on the level that one wants and bingo you're there. Why on earth would you want to go back to one-click up for each level when you can go directly to the one you want?!

bookkeeper
bookkeeper

The fact there there are differant ways to customize windows is pretty neet. To each their own as far as how they want windows to work,look, and feel. They way i see it if it helps a little then it was worth doing. Just make like a little easier. I didn't really need the up button but i had fun making it work. Thanks TechRepublic it was fun and a great tip. Signed Just an opinion

MyrnaT3
MyrnaT3

I would LOVE it if you would give the same info for adding the "delete" button ("X") to the Windows Command Bar. Thanks for the great tips!

dmolter
dmolter

Good practice for learning how to add buttons to your menu bar.

TerryN
TerryN

Can I just export this registry key file once completed and deploy to other PCs as desired?

ZoltanZ
ZoltanZ

There is ALREADY an UP BUTTON, A BACK BUTTON AND FORWARD BUTTON on my Win7 Windows Explorer windows .. so what is the deal here ?

jfuller05
jfuller05

I would like the Up button available, even if no more than for the option. :)

Mark W. Kaelin
Mark W. Kaelin

How much do you want the Up button in Windows Explorer? Did you, or do you plan, to implement this registry hack to get your Up button?

RaveDJ
RaveDJ

There are lots of things I miss about the old days/previous versions/yesteryear but I'm afraid we have to move on. Implementing workarounds like this may help some users in the short term but they likely do not work very well, don't exactly emulate what was missing, and may not work in the future. Move with the times and learn to adapt to the "new way of thinking." That's evolution.

Editor's Picks