AHK Startup Under Windows 10

Get help with using AutoHotkey and its commands and hotkeys
ThewarII
Posts: 38
Joined: 01 Oct 2014, 09:33
Facebook: [email protected]

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: when I know about AHK.
I have been using AHK for do anything in microsoft window.
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.

Return to “Ask For Help”

Who is online

Users browsing this forum: flyingDman, Google [Bot], JoeWinograd, Siopaulo, teadrinker, vsub and 107 guests