Integrate a custom Shutdown menu into the Windows 8 Desktop context menu

Integrate a custom Shutdown menu into the Windows 8 Desktop context menu

Today We Will see How to Create Shutdown menu in Right click on Desktop

Figure A

I have created a REG file that can be used to instantaneously add my full Shut Down menu to your Windows 8 system.
I'll walk you, step-by-step, through the process of editing the registry to manually add the Shut Down menu to your Windows 8 system.
Even if you opt to use the REG file method, I encourage you to read through the manual steps in case you later decide that you want customize the menu.

Make a backup

Before you begin, 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 time to back up your system by creating a system image as showed in Restore Windows 8 with System Image Recovery. That way if anything goes awry, you can restore your system and get right back to work.

By editing the registry

Overview

Before we get started let's take a generalized look at the procedure that we'll be performing as we create a custom Shut Down menu on Windows 8's Desktop context menu. To make this happen, we'll be working in two different sections of the registry.

You'll go to the HKEY_CLASSES_ROOT\DesktopBackground\Shell key and create a new subkey called Shut Down. You'll then add several entries to this new subkey to configure it as a cascading menu on the Desktop's context menu. Essentially, this new subkey will create an outline of the cascading menu.

You'll then go to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell subkey. Here, you'll define entries containing the command lines for each item that you want to add to the Shut Down menu.

As you may know, the registry in the Windows operating system is huge and navigating in it can be tricky. To make navigation easier, I'll show you how to use two features in the Registry Editor: Find and Favorites. With this in mind, let's jump in.

Launching the Registry Editor

To launch the Registry Editor in Windows 8, use the [Windows] + Q keystroke to access the Apps Search Settings page. Then, type Regedit in the text box and click Regedit.exe, as shown in Figure B. If you prefer, you can use the [Windows] + R keystroke to bring up the Run dialog box. Then, type Regedit in the Open text box and click OK.

Figure B

Accessing the Registry Editor from the Start screen is easy.

Either way that you launch the Registry Editor, you'll see a User Account Control dialog box and will need to click the Yes button. You'll then see the Registry Editor.

Creating the Shut Down cascading menu

Once you have the Registry Editor up and running, locate and right-click on HKEY_CLASSES_ROOT key and select the Find command. When you see the Find dialog box, type DesktopBackground in the text box and make sure that only the Keys check box is selected, as shown in Figure C. To continue, click the Find Next button.

Figure C

Type DesktopBackground in the Find dialog box.

When you arrive at the HKEY_CLASSES_ROOT\DesktopBackground key, double click on it to expand its tree. Then, double click on the Shell key to expand its tree. Now, pull down the Favorites menu, select the Add to Favorites command, type DesktopBackground in the text box, and click OK. Now, you can get back to the DesktopBackground key from the Favorites menu any time you need to while you are creating your cascading menu.

To continue, right-click on the Shell key and then select the New | Key command as shown in Figure D. When you see the new key appear, name it Shut Down.

Figure D

Right click on the Shell key and select the New|Key command.

After you create the Shut Down key, select it, and you'll see that it contains a single string value called Default. Just leave that key as it is. To create the outline of the cascading menu, you'll add four more string values to the Shut Down key. The Value name and Value data that you'll add are listed in Table A.

Table A: The String values that you'll add to the Shut Down key.

Value name

Value data

Icon shell32.dll,215
MUIVerb Shut Down
Position bottom
SubCommands restart;|;shutdown;hybridshutdown;|;sleep;hibernate;|;lock;logoff;switch

Let's take a closer look at these string values. As we do, look back at the Shut Down cascading menu shown in Figure A. Obviously, the Icon value specifies which icon to use - the icon is in position 215 in the Shell32.dll file. Note that there are no blank spaces in this line and the items are separated by a coma. The MUIVerb value specifies the name to assign to the menu. The Position value, which is set to bottom, specifies that the new menu should appear at the bottom on the Desktop context menu.

The SubCommands value is a bit more elaborate. This line creates the outline for the cascading menu or more specifically specifies the order in which the items will appear on the menu. As you can see, there are no blank spaces in this line and each item is separated by a semicolon. The pipe symbols are used to insert separators in the menu. Also keep in mind that the items on this line refer to the keys in the CommandStore key not on the menu itself, which is why they are in lowercase and don't match the names shown on the menu. (We'll add these keys to the CommandStore key in the next section.)

You can customize your menu by changing the icon, using a different name for the menu, changing the position, or by eliminating some of the items from the SubCommands string.

Now, to add each of these string values to the Shut Down key, right click on the Shut Down key and select the New | String Value command, as shown in Figure D. In the case of the first string value, when you see the new string value appear, name it Icon.

Figure E

Right click on the Shut Down key and select the New|String Value command.

Then double click the Icon value. When the Edit String dialog box appears, type shell32.dll,215 in the Value data text box, as shown in Figure F. Then click OK.

Figure F

Type the string from Table A in the Value data text box.

Repeat these steps to add the other three string values listed in Table A. When you are done, your Shut Down key should look like the one shown in Figure G.

Figure G

The Shut Down key will contain these four string values.

Adding the commands

Now that we have created our cascading menu structure, we'll add the commands for each item on the menu. If you have chosen to eliminate some of the items from the SubCommands string above, you'll adjust your steps accordingly.

To begin this portion of the technique, locate and right-click on HKEY_LOCAL_MACHINE key and select the Find command. When you see the Find dialog box, type CommandStore in the text box, make sure that only the Keys check box is selected, and then click the Find next button.

When you arrive at the HKEY_LOCAL_MACHINE\CommandStore key, double click on it to expand its tree. Then, double click on the shell key to expand its tree. Now, pull down the Favorites menu, select the Add to Favorites command, type CommandStore in the text box, and click OK. Now, you can get back to the CommandStore key from the Favorites menu any time you need to while you are creating your cascading menu.

At this point, you are going to add two keys to the shell key for each one of the commands that you want to appear on your menu. The first key will be a name from the SubCommands value in the Shut Down key. Inside this first key, you'll then add two string values: Default and Icon. Below the first key, you'll add a subkey named command. Inside this key, you'll add one string value: Default. The keys that you will create and the string values that you will add are shown in table in Figure H. I know that this may sound confusing at first, but bear with me and it will become clearer as we work through an example.

Figure H

This table shows all the keys and string values that you will use to create the full Shut Down menu.

As you can see, to make it easier to decipher the contents of this table, I've separated each set of keys and string values for each command you could add to the menu. The main key is in blue and a red border separates each key. Just add the keys that you specified earlier in the SubCommands value in the Shut Down key. If you decide that you don't want to include the icons on your menu, simply omit the Icon string value.

Let's begin by creating the restart key. To do so, right-click on the shell key and select the New | Key command. When you see the new key appear, name it restart. This key name must be all lowercase!

After you create the restart key, select it and you'll see that it contains a single String Value called Default. Now, double click the Default value. When you see the Edit String dialog box, type Restart in the Value data text box, as shown in Figure I. Then click OK.

Figure I

Double click the Default value and type Restart in the Value data text box.

Now, right click on the restart key and select the New | String command. When you see the new string appear, name it Icon. Next, double click the Icon value. When you see the Edit String dialog box, type comres.dll,4 in the Value data text box and click OK. When you do, your restart key will look like the one in Figure J.

Figure J

At this point you will have the Default and Icon string values in the restart key.

Now that you have created the Default and Icon string values in the restart key, you'll need to add the command key. To do so, right click on the restart key and select the New | Key command. When you see the new key appear, name it command. This key name must be all lowercase! Now, double click the Default value inside the command key. When you see the Edit String dialog box, type Shutdown -r -f -t 00 in the Value data text box and click OK. When you do, your command key will look like the one in Figure K.

Figure K

The command key only contains the Default string value.

Now, you can repeat these steps and use the information in the table in Figure H to add any of the other commands that you want to put on your custom Shut Down menu. When you are done, your CommandStore\shell key will look something like the one shown in Figure L. This screen shot shows the structure after adding each of the commands to the CommandStore\shell key.

Figure L

This screen shows the structure after adding each of the commands to the CommandStore\shell key.

Using the Reg files

As I mentioned, I created a REG file that can be used to instantaneously add my full Shut Down menu to your Windows 8 system. In addition, I have created a second REG file that will instantaneously remove the full Shut Down menu from your Windows 8 system. You can download here both these files in the linked zip file. The files are named AddShutDownMenu.txt and RemoveShutDownMenu.txt. When you want to use them, you'll need to rename the file extension from .txt to .reg.

When you are ready to add the Shut Down menu to your Windows 8 system, just double click the AddShutDownMenu.reg file. When you do, you'll see a UAC like the one shown in Figure M. Just go ahead and click Yes.

Figure M

Just click Yes to get thru the UAC.

You'll then be prompted to confirm that you want to allow the Reg file to update the registry, as shown in Figure N. Again, just go ahead and click Yes.

Figure N

At this confirmation prompt, just click Yes.

Once the changes have been added to the registry, you'll see one more confirmation dialog box, shown in Figure O. Just click OK and you'll be able to use the options on your new Shut Down menu.

Figure O

Once the changes have been added to the registry, you'll see one more confirmation dialog box.

Tracking down icons

To be able to find icons and determine their positions, I downloaded a very simple, standalone program called IconView, shown in Figure P, from Neuber Software. The program is Free and perfectly performs the task at hand.

Figure P

IconView makes it easy to find icons and their positions.

0 comments:

Post a Comment