What's 2021 best method to get your AHK script to run at startup on a Win 10 64 bit PC?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Timmy347
Posts: 109
Joined: 26 Aug 2017, 12:15

What's 2021 best method to get your AHK script to run at startup on a Win 10 64 bit PC?

Post by Timmy347 » 26 Sep 2021, 18:43

I need to RUN AS ADMINISTRATOR otherwise some of my keys don't work

Many many posts online.
But some of the very old, and offering advice that's all over the park.

Can someone provide a little help on the best 2021 way?

I just have a few simple keyboard commands in my AHK file. Nothing fancy.

This idea any good?

https://stackoverflow.com/questions/63889537/run-ahk-script-as-admin-on-startup

Thanks!
Last edited by Timmy347 on 26 Sep 2021, 19:03, edited 1 time in total.

User avatar
mikeyww
Posts: 26877
Joined: 09 Sep 2014, 18:38

Re: What's 2021 best method to get your AHK script to run at startup on a Win 10 64 bit PC?

Post by mikeyww » 26 Sep 2021, 18:48

Yep, the startup directory looks like a good one to me.

Timmy347
Posts: 109
Joined: 26 Aug 2017, 12:15

Re: What's 2021 best method to get your AHK script to run at startup on a Win 10 64 bit PC?

Post by Timmy347 » 26 Sep 2021, 19:04

mikeyww wrote:
26 Sep 2021, 18:48
Yep, the startup directory looks like a good one to me.
Oh shoot.

I forgot to put AS ADMINISTRATOR in my initial post.

I'm starting up the script via the Startup Folder now. But some of my keys don't work cuz it's not running as Administrator.

gmoises
Posts: 74
Joined: 18 Nov 2017, 16:43

Re: What's 2021 best method to get your AHK script to run at startup on a Win 10 64 bit PC?

Post by gmoises » 26 Sep 2021, 20:08

RunAsTask() - Auto-elevates script without UAC prompt | http://ahkscript.org/boards/viewtopic.php?t=4334
By SKAN, http://goo.gl/yG6A1F, CD:19/Aug/2014 | MD:22/Aug/2014

Timmy347
Posts: 109
Joined: 26 Aug 2017, 12:15

Re: What's 2021 best method to get your AHK script to run at startup on a Win 10 64 bit PC?

Post by Timmy347 » 26 Sep 2021, 20:32

gmoises wrote:
26 Sep 2021, 20:08
RunAsTask() - Auto-elevates script without UAC prompt | http://ahkscript.org/boards/viewtopic.php?t=4334
By SKAN, http://goo.gl/yG6A1F, CD:19/Aug/2014 | MD:22/Aug/2014
Thanks.

I'm new to this, and only have a simple script. Can you tell me how i would use that for this:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

RAlt::Send !{f4}

Return

Post Reply

Return to “Ask for Help (v1)”