Run, software.exe (Passing UAC)

Get help with using AutoHotkey and its commands and hotkeys
Posts: 55
Joined: 19 May 2016, 07:44

Run, software.exe (Passing UAC)

19 May 2016, 08:16


I'm new in AHK, and actually feel sad because i'm so late knowing this cool scripting language. but so excited to learn it :)

I started scripting with success in very simple scripts, but i'm facing problem running scripts that contains (Run, software.exe) on remote computers when the UAC is on. I've found couple solutions (such as: scheduled task) in this forum, but unfortunately no one worked for me on remote computer.

My script does the following:

1 - run MBAM.exe

Code: Select all

title := "Malwarebytes Anti-Malware Home"
run C:\Program Files (x86)\Malwarebytes Anti-Malware\mbam.exe
winWait, %title%
winGetPos,,,cw,ch, %title%
controlClick,% "x" cw//2 " y" ch-65, %title%
winMinimize, %title%
2- Wait the scan result of MBAM then take a screenshot (using another software) and save the Screenshot-%Var%.jpg

noted that i'm using MPS software to download my AHK script to remote computer, run it there, and email the screenshot to me. with few other steps.
another note: the remote computer doesn't have AutoHotkey installed, i'm using CMD to run my AHK script after downloading the AutoHotkey.exe file there using:

Code: Select all

[Path]\AutoHotkey.exe [Path]\My_AHK.ahk
knowing that the script works fine on any computer IF UAC is OFF! But I cannot turn UAC off on all remote computers, also cannot install AutoHotkey on them. Is there any thing I can do or include in my script so the software MBAM.exe can run without the UAC access message?
I just want to get rid of this message :crazy:

Thank you,
User avatar
Posts: 1378
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Run, software.exe (Passing UAC)

19 May 2016, 09:07

UAC is invoked when an unelevated process launches a processes requiring elevation. So it wouldn't be invoked when you run the AHK script with administrative privileges. Doing that will also invoke UAC, but earlier, perhaps that is sufficient. Otherwise you could trigger the script to run though scheduled tasks with elevated permissions. Setting up the tasks does not invoke UAC for users with sufficient permissions.
Posts: 55
Joined: 19 May 2016, 07:44

Re: Run, software.exe (Passing UAC)

19 May 2016, 09:38

Hi Nextron,

The problem is not on all computers (350+) i can run my script as Administrator.
I'm actually looking for another solution using AHK, but I will try (again) using schtasks to create task. I will need the script to run immediately, (I may use the CurrentTime as variable and schedule the task to run i.e.: on @[email protected]+3 minutes) I will see if I can make that possible in Command line, and if the command schtasks is flexible enough to chose all scheduled tasks option (i.e.: Run highest privileges)
I don't think i will find problem doing that in command line, but before starting diving in that I will wait for anything else (hopefully easier for me:) )

Thank you Nextron

Return to “Ask For Help”

Who is online

Users browsing this forum: a1987zz, addala, Aggronaught, Google [Bot], mikeyww, Netocon and 40 guests