Auto Hotkey replacing keys

-1

Never really used AutoHotkey, or done too much programming but I was hoping somebody could help me create a script to do the following;

When CTRL+ALT+DEL is pressed > send CTRL+ALT+END instead.

Csothcott

Posted 2016-07-21T12:01:07.400

Reputation: 1

Answers

1

I don't believe the Windows OS will allow you to re-map that combination

However, CTL+ALT+DEL is a special key sequence on Windows NT based operating systems (NT, 2000 and XP). On these systems CTL+ALT+DEL is called the special attention sequence (or SAS) and it has hooks deep into the NT security system which make it impossible to block this sequence in code.

Source

Even if you could, based upon your comment, it would mean updating every-ones machine... This means the user wouldn't be able to use that combination at all, unless you also some how detected if the RDP session was open.

Instead, you need to fix the issue, which is training the staff that CTRL+ALT+DEL is for the local computer and CTRL+ALT+END is for when in a remote session.

Dave

Posted 2016-07-21T12:01:07.400

Reputation: 24 199

If it helps, i'll tell you the reason for this.... I may be completely over looking a simple solution, in which case I will give myself a good kick. We have a bunch of users connecting to a remote desktop environment, who are used to logging out via ctrl alt del, which obviously is bringing up the menu locally not on the remote desktop. – Csothcott – 2016-07-21T12:10:26.227

That is a training issue then I'm afraid. I too have had to learn it when using RDP :) – Dave – 2016-07-21T12:13:54.340

1

@Dave has the right answer here. Windows explicitly denies the ability to capture or simulate that key combination. All that AutoHotkey can do is work around it. Here are a few references from the AHK help files:

BlockInput

When BlockInput is in effect, user input is blocked but AutoHotkey can simulate keystrokes and mouse clicks. However, pressing Ctrl+Alt+Del will re-enable input due to a Windows API feature.

Send / SendRaw / SendInput / SendPlay / SendEvent (General Remarks)

Since the operating system does not allow simulation of the CTRL-ALT-DELETE combination, doing something like Send ^!{Delete} will have no effect.

SendPlay

Unlike SendInput and SendEvent, the user may interrupt a SendPlay by pressing Control-Alt-Del or Control-Escape. When this happens, the remaining keystrokes are not sent but the script continues executing as though the SendPlay had completed normally.

Engineer Toast

Posted 2016-07-21T12:01:07.400

Reputation: 3 019