Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you get AutoHotKey hotkeys to work with Remote Desktop in fullscreen on Windows 7?

share|improve this question
up vote 2 down vote accepted

As user16659 notes, Reload makes the hotkeys work again (But his script did not work for me).

Basically, I now have two scripts running, one which contains my hotkeys and hotstrings "script.ahk" and another which will reload this script if RDP is maximised "controller.ahk".


#SingleInstance force
::hw::Hello World


Run "autohotkey" "script.ahk"

SetTimer, ReloadOnRDPMaximized, 500

If WinActive("ahk_class TscShellContainerClass")
    WinGet, maxOrMin, MinMax, ahk_class TscShellContainerClass

    if (maxOrMin = 0) {
        WinGetPos, PosX, PosY, WinWidth, WinHeight, ahk_class TscShellContainerClass

        if (PosY = 0) {
            ; it is fully maximized therefore reload "script.ahk"
            Run "autohotkey" "script.ahk"

            ; wait until window gets deactivated so you don't reload it again.
            WinWaitNotActive, ahk_class TscShellContainerClass

share|improve this answer
However, I have noticed that even my solution does not work because in RDP it does not send the shift key press for hot strings, e.g. if you send * then it will send 8... :( – Tahir Hassan Nov 16 '12 at 15:23
I had to do something like SendInput, {shift}8{shift up} to send * in RDP, but it will send 8 in Windows. SendInput, {shift down}8{shift up} works the other way around. – user16659 Nov 16 '12 at 17:14
Since answering your above question, I have decided to run my AHK script on the remote server (it is a LOT more reliable). I have changed controller.ahk to close script.ahk so it does not interfere with the server's script. I pasted my solution on my blog: – Tahir Hassan Dec 5 '12 at 13:46

You also need to set "Apply windows key combinations" on the "Local resources" tab of remote desktop connection 'mstsc.exe' to "ON THIS COMPUTER"MSTSC WINDOWS KEY COMBINATIONS

share|improve this answer

To make AHK work with Microsoft's Terminal Server client in fullscreen, AHK has to reload after the Remote Desktop window is activated.

SetTimer, waitforrdp, -250

SendInput, {shift}C{shift up}
SendInput, apitalized

IfWinActive, ahk_class TscShellContainerClass
    WinWaitNotActive, ahk_class TscShellContainerClass,,3600
WinWaitActive, ahk_class TscShellContainerClass,,3600
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.