It lets you always run a script as elevated, every single time without being prompted by UAC (You will be prompted once, for every new script)
You simply need to place RunAsTask() at the top of the script.
I just discovered, that you cannot pass command line arguments to a script that is going to run as elevated.
I am absolutely gutted, this throws a wrench at so many of my programs and tools.
Code: Select all
RunAsTask()
MsgBox, % A_args[1]
Code: Select all
. "C:\Temp\MyScript.ahk" "Hello World"
The only way I can get the script to receive Hello World is by uncommenting runAsTask() or running PowerShell as Admin.
Neither of which as an option for me, I use the terminal allot, I cannot imagine doing so as Admin, Its just too dangerous.
I also cannot cannot run scripts as un elevated as then they wont be able to interact with elevated processes
I don't even know what is the culprit, is it RunAsTask? Is it a general thing to do with UAC? Has anyone come across this issue before?
I would really appreciate any ideas on how to solve this issue or any insight into the cause. Thanks!