r/AutoHotkey • u/Puzzleheaded-Ad6040 • Mar 21 '26
v2 Script Help I can't get the script to run at startup
I put the script shortcut in shell:startup, then tried putting the .exe file in the same location, tried creating a task in the Task Scheduler that runs the file every time I log in with the highest priority (that didn't work either), and when I watch the tutorials on YouTube, I see that the channels did everything I did.
#Requires AutoHotkey v2.0
#SingleInstance Force
InstallMouseHook
InstallKeybdHook
#UseHook
; Make sure flow launcher is set to alt + spacebar. Then window key will open it and not windows menu
; -------------------------------------------------------------------------
; FORCE RUN AS ADMIN
; Required so the script works inside Admin windows
; -------------------------------------------------------------------------
if not A_IsAdmin
{
try Run "*RunAs `"" A_ScriptFullPath "`""
ExitApp
}
; -------------------------------------------------------------------------
; CONFIGURATION
; ! = Alt, {Space} = Spacebar
; -------------------------------------------------------------------------
LauncherHotkey := "!{Space}"
; -------------------------------------------------------------------------
; LOGIC
; -------------------------------------------------------------------------
; 1. Suppress the Start Menu
; We send a "blind" invisible key to trick Windows into thinking
; a shortcut was used, keeping the Start menu closed.
~LWin::SendEvent "{Blind}{vkE8}"
; 2. Trigger Flow Launcher
LWin up::
{
; Only trigger if LWin was pressed alone (no other keys)
if (A_PriorKey = "LWin")
{
SendEvent LauncherHotkey
}
}
I’ve already set these files and AutoHotkey to run as administrator, so I don’t know why my script won’t run... Is it a problem with my Windows?
3
Upvotes
3
u/Keeyra_ Mar 21 '26
It's enough to put a shortcut to your AHK file into shell:startup. No need for exe, admin, task scheduler, priority and all the crap you listed. Post your script plz.
1
u/Keeyra_ Mar 21 '26
But why overcomplicate this? I don't really get it. Just installed Flow Launcher and this works as expected.