-3

How can I to create a logoff shortcut, a suspend one and a shutdown one? I know how to make the shortcut but when I add a hotkey they only work on the log off one and after a while it stops working all together. I do have administrative access on my home PC, but not at work; the shortcuts do work but I’m having the same issues.

I want to be able to drag it off my USB flash drive onto the desktop and for them to work. Also would they work hidden? Also I don't have access to cmd or windows + r at work.

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
  • keyboard shortcut or a desktop shortcut. What is wrong with the shortcut(s) that already exist by default? – Ramhound Oct 07 '15 at 15:53
  • You can find your answers [here](http://superuser.com/a/42128/270195) – clhy Oct 07 '15 at 15:54
  • @Ramhound I'm creating a desktop shortcut and in the options i'm using hotkey.They work when you click on them but the hotkeys don't activate them. – prime gaming Oct 07 '15 at 15:55
  • 1
    Possible duplicate of [How can I put the computer to sleep from Command Prompt/Run menu?](http://superuser.com/questions/42124/how-can-i-put-the-computer-to-sleep-from-command-prompt-run-menu) – Ramhound Oct 07 '15 at 16:00
  • @ramhound I don't have access to cmd or windows + r. – prime gaming Oct 07 '15 at 16:02
  • So that means you have no keyboard? If you have no keyboard then you cannot do what you want. If you make a ridiculous statement as "I have not looked at any possible duplicate but they don't have the same issue as me" you have to understand people are going to flag your question as a duplicate because you have exactly the same issue. – Ramhound Oct 07 '15 at 16:29
  • I have a keyboard, cmd is deactivated and shortcuts like windows + r are blocked. – prime gaming Oct 07 '15 at 16:32

2 Answers2

0
  1. Create a batch file, e.g. sleep.bat, containing the following text:

rundll32.exe powrprof.dll,SetSuspendState 0,1,0

Make a shortcut to it (right-click, drag to a folder, and Create shortcuts here); name it as you like. Right-click on the new shortcut, select Properties and set the Shortcut key combination.

  1. For Logoff, follow the steps above but use the following script:

shutdown -l

  1. See MS TechNet guide to the Shutdown command for Shutdown, Hybrid Shutdown, Restart etc.

N.B. Hibernate has been deprecated for Windows 8, but if you have it enabled in PowerCfg, then the first script may Hibernate, rather than sleep.

DrMoishe Pippik
  • 25,661
  • 4
  • 36
  • 54
0

Create a shutdown.bat file from a text document with the following text: shutdown.exe -s -t 0

Save as Shutdown.bat > then create a shortcut and place it on your desktop.

To create a restart button, change -s to -r;

to create a logoff button, change -s -t 0 to -l.

Then create corresponding shortcuts for those and change the icons to something more suitable in the shortcut's properties.

EDIT: This works without administrative permission on all Windows systems as far as I am aware.

Dooley_labs
  • 352
  • 1
  • 13