Monday, November 12, 2012

How to Create a Power Button in Windows 8

When getting started with Windows 8, one of the most confounding things is figuring out how to Shut Down.  Even after using it awhile, it still seems to take too many steps: bring up Charms, hit Settings, hit Power, hit Shut Down.

Previously I posted a way to create a permanent Start Button in Windows 8, using only built-in Windows features.  After playing around with it some more, I found you can do something similar to create a Power button.

Once it’s set up, hitting one button on the taskbar will bring up Windows’ Shut Down dialog, from which you can Sleep, Restart, Shut Down, etc.


How to Make a Power Button in Windows 8:

  1. In your Documents folder, create a new folder called Toolbars.  Place the icon of your choice inside.  I used this one (right-click link and select "Save As...").
     
  2. Start Notepad.  Copy and paste in this line of code:

    CreateObject("WScript.Shell").SendKeys "%{F4}"

    Save the file in that same Toolbars folder. Call it “ShutDown.vbs”.
     
  3. Inside that Toolbars folder, create a new subfolder called Shut Down.
     
  4. Right-click on the ShutDown.vbs file and select Copy.  Open the Shut Down folder, right-click and select “Paste Shortcut”.  Rename the shortcut “Shut Down”.  Then right-click the shortcut, select “Properties” and click the “Change Icon…” button.  Select the icon from Step 1.
     
  5. On an empty part of the Windows Taskbar, right-click and de-select “Lock all taskbars”.
     
  6. On an empty part of the Windows Taskbar, right-click, select “Toolbars”, then “New Toolbar…”  Select the Shut Down folder from Step 3.
     
  7. By right-clicking your new Shut Down toolbar, you can customize the way it looks.  De-select “Show Title” and “Show Text”, and under the “View” menu, select “Large Icons”.
     
  8. Reposition and resize your Shut Down toolbar as you see fit, then right-click the taskbar and re-enable “Lock all taskbars”.
So basically this creates a script that presses Alt-F4, which is Windows’ key combination for closing whatever window has focus.  Since the button you press is on the taskbar, the taskbar gets focus and it assumes you want to close Windows itself.

If you found this useful or have any tips for improving it, leave me a note here!

1 comment: