3

I'm running an application using an Authotkey script, which requires UAC. I've read some post about it, but I can't get a clear answer explaining why it seems not possible to accept the prompt using Autohotkey.

My code is something like this:

Run,"%A_ProgramFiles%\someprogram.exe",,Max

Send !Y ; Send Alt-Y

I understand the process dispatched by the first line is halt by UAC, but the autohotkey process should continue working, right? I tried inserting a pause before, and also with mouseclick, unsuccessful.

Thanks,

Community
  • 1
  • 1
Sebastian
  • 1,835
  • 3
  • 22
  • 34

2 Answers2

4

No, the autohotkey process should not run in the secure desktop where the UAC prompt is displayed. See http://blogs.msdn.com/b/uac/archive/2006/05/03/589561.aspx and http://technet.microsoft.com/en-us/magazine/2009.07.uac.aspx for details.

Nicole Calinoiu
  • 20,843
  • 2
  • 44
  • 49
0

I use a TIMER to check for the presence (WINEXIST) of alert windows every second or so.

IF WINEXIST alert window Send !Y

Otherwise, your !Y is typing into the ether, and not into the UAC alert window

dwilbank
  • 2,470
  • 2
  • 26
  • 37
  • Like Nicole said, the UAC prompt (`consent.exe`) runs under the `SYSTEM` account. Therefore, AutoHotkey which runs under the user’s account would not have access to the prompt at all (that’s the whole point; to prevent injection and auto-clicking by malware). – Synetech Jul 03 '14 at 18:02