WINDOWS TUTORIAL | Are you in my situation, where you have moved over to a new keyboard, only to find out that your favourite key is omitted? I'm talking about the SLEEP key! Putting the computer to sleep, or hibernation, if you will, is certainly a great way of saving some power, as well as getting rid of that constant hum generated by the fans of your idle computer.

You can of course find the "sleep" option in the "Start" menu within Windows, hidden in a sub-menu to the "Shut down" option. But that's a way too time consuming procedure, because you'll probably need the option to sleep the most when you're already moving away from your computer, and ergo, you need a quick shortcut!

So, if you're precious sleep button is nowhere to find, the next best thing is to map the sleep function to another key, or combination of keys, rather - a so-called macro.
This is not too difficult, luckily, and you won't be needing any additional software to be installed. If you're on Windows, you'll already have everything needed, as everything regarding the power management of the PC  is basic functionality to any operating system. So, here's what you need to do...

Tutorial

Shortcut assignment

  1. First off, you'll need to create a shortcut. Minimise whatever you have open and right-click on any free space of your desktop. Choose "New" > "Shortcut" from the little popup menu. 
  2. In the "Type the location of the item" field type in the following:
    Rundll32.exe Powrprof.dll,SetSuspendState Sleep
    Then click Next.
  3. This will create a shortcut with the name rundll32, which you can rename to something more descriptive, like "Sleep" or whatever you prefer.

    Now you already have a desktop shortcut that you can hit, to quickly put the computer to sleep. But that's not all, we want to assign this functionality to a keyboard shortcut as well, for some extra convenience.

  4. Right-click your newly created sleep shortcut, and choose "Properties", and a new dialogue window will appear.
  5. Under the Shortcut tab within this dialogue, click on the field labelled "Shortcut key". Now enter any combination of keys you'd like to use in order to put the PC to sleep. I chose Ctrl, Alt + S myself, but you can use the Shift key as well, such as Ctrl, Shift + X.

    Custom icons

    That should do it. The following steps are by no means necessary (except for the last one), but if you want to use a proper shutdown icon for your shortcut, you can do this as well:

  6. Still with the "Properties" dialog open, click the button saying "Change icon...".
    Note: 
    If you don't see any icons in the new window that just popped up, make sure to navigate to this folder:
    %SystemRoot%\system32\SHELL32.dll
    ...Where %SystemRoot% is usually C:\Windows\.... or C:\WinNT\.... depending on your version of Windows.Once
  7. Pick your icon of choice and click the "OK" button in the "Change icon" dialogue.
  8. Lastly hit the "OK" button of the "Properties" dialogue, in order to apply your new keyboard shortcut and cool looking icon!

You can now open this shortcut whenever you desire, either with your keyboard shortcut, or by simply clicking the icon on your desktop.

If you want, you can also add buttons and keyboard shortcuts to hibernate, log off, restart or shut down the computer. This is actually even easier. Do exectly the same as above, except for step 2, where you run of the programme shutdown, instead of rundll32. So if you want the computer to hibernate, use the command  "shutdown.exe /h". If you just want it to log log-off, you can instead type "shutdown.exe /l". Furthermore you can use the switches /r or /s for restart or shutdown, respectively.

Hope you found this tutorial helpful. If you do, please give it a vote up on these sites:

Comment and rate this article on:
Delicious | digg | JotLinks | reddit