POSTS / How to Add Programs to Startup in Windows 11
Run the following code in PowerShell.
# Add to startup:
New-ItemProperty -Path HKCU:SoftwareMicrosoftWindowsCurrentVersionRun -Name app-name -PropertyType String -Value path-to-app
# Remove from startup:
Remove-ItemProperty -Path HKCU:SoftwareMicrosoftWindowsCurrentVersionRun -Name app-name
Reference: Configure startup applications in Windows
Or use schtasks commands to create a task not only on startup but with more complicated rules.