'How to launch .ahk file when PC starts
^B::
Send, Hello World
return
This is my script-file made for AutoHotKey. How can I launch this file automatically when my PC starts? Now it is is all fine, but after reboot I've to launch it manually. Thanks!
Solution 1:[1]
You’re gonna have to add it to your startup programs
Press Windows key + R, paste this file path in there and press enter: %appdata%\Microsoft\Windows\Start Menu\Programs\Startup
Right click -> New -> Shortcut
In the shortcut window click on “Browse” and then select your AHK file
Solution 2:[2]
to do that:
1. press win+r
2. type shell:startup
3. copy paste your ahk file from the folder to the place which just opened
… and you‘re done!
Solution 3:[3]
You can Use the Windows Registry.
It Will Launch the .ahk File automatic after rebooting your System.
Try this AHK Code:
c:\examples\example1.ahk
^B::
Send, Hello World
return
^r::
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Run,example1,"c:\examples\example1.ahk" /background
return
You can press (Ctrl + r) it will put the values into the Registry.
Now you are ready to go. Everytime if you Start your PC, it will Automatic run the example1.ahk File.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | T. H. |
Solution 2 | |
Solution 3 |