AHK Startup Under Windows 10

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ThewarII
Posts: 49
Joined: 01 Oct 2014, 09:33

Re: AHK Startup Under Windows 10

03 Jan 2020, 06:14

09KR0058 wrote:
15 Apr 2016, 14:14
After spending WAY too much time on this, I found a better way. Just add the following registry key. (This is Windows 10 Professional 64-bit)

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run
New -> String Value
Name = AutoHotkey
Value = "C:\Program Files\AutoHotkey\AutoHotkey.exe"

All of the following locations did not work, but the one above did.
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
C:\Users\(username)\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

Hopefully this post will save some people all the grief I've been through trying to find a simple way to get AHK to run at startup.
and 1 more way
This is use with Task Schedule
I make 1 file StartupA.exe and tried put it in HKLM, HKCU, C:\user, C:\ProgramData, but only 1 way run my AHK when log on is Task Schedule.
or i make wrong in that so didn't run but it show in Task Manager. :sick: :sick:
I :superhappy:(happy) when I know about AHK.
I have & am using AHK to do anything in windows microsoft.
The first time, I know it in around year 2013.
splow
Posts: 1
Joined: 08 Oct 2019, 14:31

Re: AHK Startup Under Windows 10

19 Jan 2020, 23:24

Ok - so I am not sure why there is not more activity on this topic, but this little previously simple task of adding a shortcut that worked in Win 7 that no longer does in Win 10 really annoyed me.

Some background bits of info that I've learnt along the way:
1. You need to run .ahk as admin for many functions to work.
2. If you put a shortcut in the startup folder, with "Run as Administrator", it will not run at startup.

Other replies in this thread that made me keep looking for a better solution:
1. I prefer not to use Task Scheduler. There should be an easier method.
2. I prefer not to use Registry editor. There should be an easier method.
3. Compiling to .exe is not an option for me. I frequently edit my default .ahk and have shortcut keys assigned to open the .ahk and another to reload it. I really do edit this on a weekly basis to automate different tasks. I would rather just start my .ahk manually at each reboot than compile to .exe

For those who share my situation and opinion, I have found a solution! :)
1. Put a shortcut for you .ahk in the startup folder - to make it appear in the startup Apps, I have found this to be the easiest method:
- Run (as in win + R): shell:common startup
- Put your shortcut here, WITHOUT "Run as Administrator"
2. In your script, at the top
- Include:

Code: Select all

if not A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
Credit: https stackoverflow.com /questions/43298908/how-to-add-administrator-privileges-to-autohotkey-script Broken Link for safety
- Note the comment in the stackoverflow post about #SingleInstance Force

Hope this helps lots of folks out there equally frustrated by this issue.
becritical
Posts: 21
Joined: 23 May 2016, 03:28

Re: AHK Startup Under Windows 10

24 Apr 2020, 03:58

Thank you for the suggestion but not even this worked for me. I had to resort to task schedule.

I really don't understand because on a clean installation of Win 10 putting a shortcut in the startup folder worked just fine, then suddenly the scripts were not starting anymore.

If anybody has figured out what is causing this I would like to know.
DocBadwrench
Posts: 8
Joined: 19 May 2017, 11:03

Re: AHK Startup Under Windows 10

11 Dec 2020, 11:51

I just wanted to chime in because I just updated my work laptop and found myself in a similar position. I found a solution to this: Download WinAeroTweaker and use the Create Elevated Shortcut function and use that in your startup folder. Once you reboot you'll find that your AHK file executes. I'm sooo happy to have solved this.
ThewarII
Posts: 49
Joined: 01 Oct 2014, 09:33

Re: AHK Startup Under Windows 10

05 Feb 2021, 23:22

You also can use Task Scheduler of Windows 10 for "AHK Startup Under Windows 10"
I :superhappy:(happy) when I know about AHK.
I have & am using AHK to do anything in windows microsoft.
The first time, I know it in around year 2013.
fugue
Posts: 1
Joined: 29 Apr 2021, 03:29

Re: AHK Startup Under Windows 10

29 Apr 2021, 03:40

splow wrote:
19 Jan 2020, 23:24
For those who share my situation and opinion, I have found a solution! :)
1. Put a shortcut for you .ahk in the startup folder - to make it appear in the startup Apps, I have found this to be the easiest method:
- Run (as in win + R): shell:common startup
- Put your shortcut here, WITHOUT "Run as Administrator"
2. In your script, at the top
- Include:

Code: Select all

if not A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
Credit: https stackoverflow.com /questions/43298908/how-to-add-administrator-privileges-to-autohotkey-script Broken Link for safety
- Note the comment in the stackoverflow post about #SingleInstance Force

Hope this helps lots of folks out there equally frustrated by this issue.
I have struggled to solve this problem and tried several methods mentioned here, with one or more problems still remaining. Yours works like magic without much modification to the Window system and has easy portability. I don't have to make a script executable. I can run the script with System Administrator's privilege. And I can run it on startup. All this is possible by adding just two more lines of script. I have registered with the AHK community to express my thanks to you.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 364 guests