Autohotkey script not running on startup

Autohotkey script not running on startup

So I have two scripts in shell:startup. One that is a bunch of hotkeys to do various things when I push ctrl+c/a/s/etc. and the other is meant to run something once at boot up and that's it.
The problem is that the on boot script is not working. Nothing happens from it on power on.
If I run the script manually it does work as intended. I tried adding a sleep as I thought maybe it was running before some required stuff was loaded, but still no luck, even with a 10 minute delay. The script never does anything, it is never shown in the taskbar.
What is the problem?
I can provide the script if necessary, but since it doesn't look like it loads at all I don't think its a coding problem.


Answer 1:

I had same problem in win10, the solution is to edit the startup registry directly.

  1. run regedit
  2. browse to
  3. Add new String Value
  4. For Value Data, input path to your .ahk file

That’s it.

Answer 2:

Not sure if you had this running in anything prior to Windows 10, but when I upgraded from Windows 7 I found that some of my AutoHotKey scripts stopped working on load. I finally figured out it was because they now needed admin rights (I don’t think they needed them in Win7), but Win10 blocks the items in the shell:startup and shell:common startup locations from running as admin.

My solution is a little convoluted but works well. Basically, I left my script in a normal (non-startup) location, such as C:\Users\xyz\Documents and then created a shortcut to the script in that same location. You can then set the properties of the shortcut to run as admin. Finally, in the shell:startup location, I created a batch file that would autorun and call the shortcut:

start "MyScript" /D "C:\Users\xyz\Documents\" /B MyScript.ahk.lnk
Related:  Trying to launch media creation tool - “Something happened 0x80070002 - 0x20016”

Our Awesome Tools