Recently upgraded from Windows 7 Ultimate to Windows 10 Pro and AHK is not automatically starting at bootup like it did under Win 7. Its in the Startup folder and that shortcut is set to run as administrator.
What am I missing?
Thanks
AHK Startup Under Windows 10
Re: AHK Startup Under Windows 10
It's because the shortcut is set to run as Administrator. I guess MS decided to skip running of shortcuts in the Startup folder with the admin compatibility option ticked because seeing a UAC prompt at startup doesn't make for good user experience. I don't know if there's a workaround to re-enable running these sort of shortcuts, but here's what I do instead:
You can use the Task Scheduler to start AutoHotkey. The Task Scheduler will start AHK with full UAC elevation without prompting you for confirmation. Here's two guides for doing this: here and here. Just a word of note: the Task Scheduler will start AutoHotkey with low priority. You can use Process, Priority in your script to readjust the priority back to Normal, or you can export the task, edit the priority in the XML and reimport it.
You can use the Task Scheduler to start AutoHotkey. The Task Scheduler will start AHK with full UAC elevation without prompting you for confirmation. Here's two guides for doing this: here and here. Just a word of note: the Task Scheduler will start AutoHotkey with low priority. You can use Process, Priority in your script to readjust the priority back to Normal, or you can export the task, edit the priority in the XML and reimport it.
Re: AHK Startup Under Windows 10
Ok, thanks. What a PITA! Seems like there should be a way to tell Windows that you completely trust certain applications.
Re: AHK Startup Under Windows 10
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.
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.
Re: AHK Startup Under Windows 10
Weird. Mine runs at startup without any hassle.
Never had any issues with it even after moving to W10 x64.
Never had any issues with it even after moving to W10 x64.
Re: AHK Startup Under Windows 10
Just curious, do you have AHK in one of the two startup folders?Oldskool wrote:Weird. Mine runs at startup without any hassle.
Never had any issues with it even after moving to W10 x64.
Re: AHK Startup Under Windows 10
Same here. All of my scripts just worked when I upgraded from Win7 -> 8 -> 10.Oldskool wrote:Weird. Mine runs at startup without any hassle.
Never had any issues with it even after moving to W10 x64.
Re: AHK Startup Under Windows 10
The scripts have always worked fine. The problem was getting AutoHotkey to start automatically when Windows is booted up.kczx3 wrote:Same here. All of my scripts just worked when I upgraded from Win7 -> 8 -> 10.Oldskool wrote:Weird. Mine runs at startup without any hassle.
Never had any issues with it even after moving to W10 x64.
Re: AHK Startup Under Windows 10
Over here AHK starts up because I have .ahk scripts that are running on boot.
So no need to add it to startup folders for me, just the scripts will do.
So no need to add it to startup folders for me, just the scripts will do.
Re: AHK Startup Under Windows 10
You're not making sense. AHK doesn't just run. It has to have a script to execute. you put shortcuts to compiled AHK apps or to .ahk files.09KR0058 wrote:The scripts have always worked fine. The problem was getting AutoHotkey to start automatically when Windows is booted up.kczx3 wrote:Same here. All of my scripts just worked when I upgraded from Win7 -> 8 -> 10.Oldskool wrote:Weird. Mine runs at startup without any hassle.
Never had any issues with it even after moving to W10 x64.
Re: AHK Startup Under Windows 10
Are you saying that you just put a .AHK file in your startup folder and that script runs at boot up? Does that then load AutoHotkey so that it is active in the system tray?Oldskool wrote:Over here AHK starts up because I have .ahk scripts that are running on boot.
So no need to add it to startup folders for me, just the scripts will do.
Re: AHK Startup Under Windows 10
Sorry if I'm not making any sense to you. I've been using AutoHotkey for almost 10 years and I've always had the executable in my startup folder so it would load when I boot the machine. So yes, it does "just run". At startup, the executable loads with its icon showing in the system tray so it is then active for all the hotkeys I use on a daily basis. I have a fairly significant autoexecute script at the beginning of my AutoHotkey.ahk file that runs when the exe loads. Even if I wasn't doing anything with the autoexecute section of the AHK file, it would still "just run" and be active in the system tray.kczx3 wrote:You're not making sense. AHK doesn't just run. It has to have a script to execute. you put shortcuts to compiled AHK apps or to .ahk files.09KR0058 wrote:The scripts have always worked fine. The problem was getting AutoHotkey to start automatically when Windows is booted up.kczx3 wrote:Same here. All of my scripts just worked when I upgraded from Win7 -> 8 -> 10.Oldskool wrote:Weird. Mine runs at startup without any hassle.
Never had any issues with it even after moving to W10 x64.
Re: AHK Startup Under Windows 10
You can make a script add itself to the start folder like this : (simplified version)
It's then no longer needed to run AHK as it will be launched
I can understand the confusion about this since when you install AHK and run it, it does launch a sample script in the systray lol
Maybe they should change that to something more useful. (can't be less useful really or you'd have to show nothing )
Code: Select all
FileCreateShortcut, %A_ScriptFullPath%, %A_Startup%\My AHK Script.lnk, %A_ScriptDir%
I can understand the confusion about this since when you install AHK and run it, it does launch a sample script in the systray lol
Maybe they should change that to something more useful. (can't be less useful really or you'd have to show nothing )
Re: AHK Startup Under Windows 10
Ah, Ok, now I understand. After all these years, I'm still learning AHK! I just didn't think there was a way to get that AHK icon in the system tray without starting the EXE at startup.Oldskool wrote:You can make a script add itself to the start folder like this : (simplified version)It's then no longer needed to run AHK as it will be launchedCode: Select all
FileCreateShortcut, %A_ScriptFullPath%, %A_Startup%\My AHK Script.lnk, %A_ScriptDir%
I can understand the confusion about this since when you install AHK and run it, it does launch a sample script in the systray lol
Maybe they should change that to something more useful. (can't be less useful really or you'd have to show nothing )
Thanks for the help!!!!
Re: AHK Startup Under Windows 10
You're very welcome.09KR0058 wrote:Are you saying that you just put a .AHK file in your startup folder and that script runs at boot up? Does that then load AutoHotkey so that it is active in the system tray?
I got a little carried away and forgot to reply to your question clearly btw:
Every script has a systemtray icon of it's own if it's not manually disabled by #NoTrayIcon.
AHK itself doesn't have one as it just runs in the background.
On a sidenote:
I have so many tray icons that I used to compile my scripts and add an icon in the compiler or set a tray icon for the ahk scripts.
Now it's just too much hassle to either make an icon or scan windows dlls for icons so i have many [H]
(now if only AHK could multithread out of the box then I could maybe put all my apps into one easily)
Re: AHK Startup Under Windows 10
Don't mean to beat a dead horse here, but when I start the AutoHotkey executable at boot time, it does place an icon in the system tray. This got me wondering if that's only because when it starts, its loading the default script at C:\Users\(user name)\Documents\AutoHotkey.ahk.Oldskool wrote: Every script has a systemtray icon of it's own if it's not manually disabled by #NoTrayIcon.
AHK itself doesn't have one as it just runs in the background.
BTW, never got to a point myself where I was compiling scripts. As much as I use AHK on a daily basis, on every machine I touch, I never really saw the need.
Thanks again for all the info.
Re: AHK Startup Under Windows 10
For me, AHK working on startup depended on the version of Win10. I have two Machines, both upgraded from Win7; one is Win10 Professional and the other Win10 home. Both machines automatically started AHK on startup as expected under Win7. However, upon installing the free upgrade to Win10, only the Home version continued to start AHK on startup. The Professional version did not. For my pro machine, I am going to try the registry solution provided by 09KR0058...
Re: AHK Startup Under Windows 10
For what it is worth and being late to the ball game, I corrected the issue on my end by creating a shortcut to AutohotKey.ahk located in my documents directory, where in windows 7 on startup was launched automatically. Please note this shortcut can be whatever you want.
Please do the following.
Hold down the Windows key, and type R.
Type: shell:startup
Click OK.
move the shortcut to the Startup folder that has now opened up.
now on login the *.ahk file will open and the icon will be found once again in the system tray and autohotkey will work just like it once did.
another way would be by system task.
Cheers.
Please do the following.
Hold down the Windows key, and type R.
Type: shell:startup
Click OK.
move the shortcut to the Startup folder that has now opened up.
now on login the *.ahk file will open and the icon will be found once again in the system tray and autohotkey will work just like it once did.
another way would be by system task.
Cheers.
Re: AHK Startup Under Windows 10
I tried both tutorials on this page on how to create a task to run on startup, also tried placing AutoHotKey.exe and my .ahk file in my startup folder. Nothing worked.
I know I'm pretty late to the game, but I just wanted to share what worked for me in case anyone is having the same issues.
I am running Windows 10 Professional 64bit.
1. navigate to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AutoHotkey"
2. double click 'Convert .ahk to .exe'
3. under 'Source', select the .ahk script that you want to run on startup
4. leave 'Destination' blank
5. if you want to, select a custom icon and a base .bin file (p.s.: I left these at their default values. I also left the 'Use MPRESS (...)' box checked)
6. click >Convert<
7. when the 'Conversion complete' popup shows up, there will be a .exe file with the same name as the .ahk file you selected in the same directory as your .ahk file
8. navigate to your startup folder ("C:\Users\<yourUserName>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup")
9. place your .exe file here
10. repeat steps for each .ahk file you want to run on startup
I know I'm pretty late to the game, but I just wanted to share what worked for me in case anyone is having the same issues.
I am running Windows 10 Professional 64bit.
1. navigate to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AutoHotkey"
2. double click 'Convert .ahk to .exe'
3. under 'Source', select the .ahk script that you want to run on startup
4. leave 'Destination' blank
5. if you want to, select a custom icon and a base .bin file (p.s.: I left these at their default values. I also left the 'Use MPRESS (...)' box checked)
6. click >Convert<
7. when the 'Conversion complete' popup shows up, there will be a .exe file with the same name as the .ahk file you selected in the same directory as your .ahk file
8. navigate to your startup folder ("C:\Users\<yourUserName>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup")
9. place your .exe file here
10. repeat steps for each .ahk file you want to run on startup
Re: AHK Startup Under Windows 10
Hi mvhrzg,mvhrzg wrote: ↑23 Jun 2017, 10:15I tried both tutorials on this page on how to create a task to run on startup, also tried placing AutoHotKey.exe and my .ahk file in my startup folder. Nothing worked.
I know I'm pretty late to the game, but I just wanted to share what worked for me in case anyone is having the same issues.
I am running Windows 10 Professional 64bit.
1. navigate to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AutoHotkey"
2. double click 'Convert .ahk to .exe'
3. under 'Source', select the .ahk script that you want to run on startup
4. leave 'Destination' blank
5. if you want to, select a custom icon and a base .bin file (p.s.: I left these at their default values. I also left the 'Use MPRESS (...)' box checked)
6. click >Convert<
7. when the 'Conversion complete' popup shows up, there will be a .exe file with the same name as the .ahk file you selected in the same directory as your .ahk file
8. navigate to your startup folder ("C:\Users\<yourUserName>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup")
9. place your .exe file here
10. repeat steps for each .ahk file you want to run on startup
Some days ago I've upgraded my Windows 7 Professional installation on my PC to Windows 10 Professional and also had the problem that my AutoHotkey script wasn't activated automatically on Windows startups although my .ahk file was in the folder C:\Users\MyUsername\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. After some Internet searches I tried to set up the program C:\Program Files\AutoHotkey\AutoHotkeyU64.exe to start with administrator rights but that didn't solve the problem. Further Internet searches also led to this thread. To my pleasure I haven't tried any other approach before I found your post. Then I tried your approach and to my pleasure it worked immediately. After this I tried to deactivate the administrator rights for AutoHotkeyU64.exe again and my script was still activated automatically on Windows startup. So thanks to you my problem is solved now. Thank you very much. I am using AutoHotkey version 1.1.30.03 on Windows 10 Professional 64 bit version 1803.
Kind regards,
John
Who is online
Users browsing this forum: Google [Bot], JoeWinograd, prototype_zero, yabab33299 and 164 guests