title: AutoHotkey Win+X Power Users Menu
body: <p>Anyway to get AutoHotkey to pop the Power Users Menu in Windows 8.1?  Typically accessed via Win+X.  I can get AHK to perform other Windows key based key combinations, such as Win+D, but the Win+X refuses.  I have several other AHK scripts that work fine, all UAC issues have been eliminated.  I have tried 'Send, {LWin Down} x {LWin Up}', 'Send, #x', changing SendMode to all various modes had no effect.  Running the AHK script as Admin had no effect, not surprisingly since I am running as Administrator and I have UAC turned completely off.</p>
  
  <p>You may ask why I want to do this.  The reason is I want access to the 'Shutdown or sign out' menu, so I can trigger either restart or shutdown.  This is so I can use an AHK to trigger my machine to restart or shutdown (laptop).  I am doing this, because what I had been using previous to Win 8.1 stopped working, which was was, for example to shut down, 'Shutdown, 9'.  The computer shuts down, but then starts back up, totally strange.  When I use the Win+X menu, or Start8 (highly recommended) it works fine, and stays off.  I even tried skipping AHK and was via my MS keyboard able to trigger a command-line one liner of 'Shutdown -s -f -t 00' which behaves the same as the AHKs attempt at shutting my computer down.  And to review, the Win+X and Start8 shutdown options work fine.  </p>
  
  <p>So far this is WAY more work than it should be to trigger a shutdown from a button on my keyboard!  </p>
  
  <p>Any help is much appreciated.</p>
  
  <p>EDIT: Example code was requested, please find the AutoHotkey Script shown below, as described the Power Users Menu does not appear.</p>
  
  <pre><code>#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  SendMode Play  ; Recommended for new scripts due to its superior speed and reliability.
  SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  
  MsgBox, 4097, , ---------- The system will restart in 5 seconds. ----------, 5
  IfMsgBox Timeout
  {
  ;Shutdown will continue
  }
  else IfMsgBox Cancel
  {
    MsgBox Shutdown canceled.
    return
  }
  
  ;Does not work
  ;Send {LWin Down} x {LWin Up}
  
  ;Does not work
  Send, #x
  </code></pre>