Load script as administrator through exe

Get help with using AutoHotkey and its commands and hotkeys
User avatar
chill8888
Posts: 41
Joined: 03 Dec 2016, 01:26

Load script as administrator through exe

05 Jun 2019, 20:20

I have a renamed AutoHotkey exe (so that it will show in Task Manager) and I use a startup script to load it when I login to my account. But for some reason, it doesn't actually run as admin. When I manually right click the ahk and run as admin, it works just fine, but not when it loads through the exe.

This is my startup script:

Code: Select all

RunAs, UserName, Password
Run, "%A_WorkingDir%\HTPC AHK-U64.exe" "%A_WorkingDir%\HTPC Hotkeys.ahk"
User avatar
YoucefHam
Posts: 344
Joined: 24 Aug 2015, 12:56
Facebook: https://fb.me/YoucefHamDz
Google: [email protected]
GitHub: YoucefHam
Location: Algeria
Contact:

Re: Load script as administrator through exe

10 Jun 2019, 19:51

try this

Code: Select all

RunAs, UserName, Password
Run, *RunAs "%A_WorkingDir%\HTPC AHK-U64.exe" "%A_WorkingDir%\HTPC Hotkeys.ahk"
:wave: There is always more than one way to solve a problem. ;)

Return to “Ask For Help”

Who is online

Users browsing this forum: anv, Bing [Bot], JAutohotkey, mikeyww, RayB, TheProdigyC2, TXShooter, yawikflame and 41 guests