Last active
March 15, 2021 11:53
-
-
Save guychouk/159cac455b2a5336e3a2e9519c850349 to your computer and use it in GitHub Desktop.
Register a Scheduled Task to run AutoHotkey script at Windows startup (specifically on user logon).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Register-ScheduledTask ` | |
-TaskName "AHK-Macros" ` | |
-Action $(New-ScheduledTaskAction -Execute "path\to\ahk.exe" -Argument "D:\Drive\etc\macros.ahk" -WorkingDirectory "D:\Drive\etc") ` | |
-Trigger $(New-ScheduledTaskTrigger -AtLogOn) ` | |
-Principal $(New-ScheduledTaskPrincipal -GroupId "BUILTIN\Administrators" -RunLevel Highest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment