Windows App Auto Launch
Overview
Automate launching a chosen set of Windows applications after logon, with
workday-only filtering and per-app delays. The skill registers a Windows
Scheduled Task (logon trigger) that runs a PowerShell launcher, which reads a
JSON config and starts each app in turn. Ideal for "boot my PC, log in, and
have WeChat / browser / notes already opening while I grab coffee."
When to use
- "工作日电脑启动后,延时启动桌面上的某几个应用"
- "Set my work apps to open automatically on weekday mornings"
- "Create a scheduled task to start <app> when I log in"
- "延迟启动桌面上的微信、QQ、笔记软件"
How it works (architecture)
Windows Task Scheduler (AtLogOn, current interactive user)
|
v
scripts/setup_auto_launch.ps1 -> registers the task (run once)
|
v
scripts/auto_launch.ps1 -ConfigFile scripts/launcher-config.json
|
| 1. optional workday check (Mon-Fri)
| 2. optional holiday check
| 3. initialDelaySeconds wait
| 4. Start-Process each app, sleep delayAfterSeconds between them
v
Configured apps launched on the desktop
Bundled files:
scripts/auto_launch.ps1— the launcher run by the task. Pure ASCII.scripts/setup_auto_launch.ps1— registers/updates/removes the task.assets/launcher-config.template.json— config schema reference.references/windows-task-scheduler.md— troubleshooting & commands.
Workflow
Step 1 — Collect requirements
Determine, from the user or a sensible default:
- Which apps — accept either a desktop
.lnkshortcut path
(e.g.C:\Users\HW\Desktop\WeChat.lnk) or a direct.exepath
(e.g.C:\Program Files\Tencent\QQ\Bin\QQ.exe).Start-Processresolves
.lnkfiles to their target automatically. - Order and delays — initial wait after logon, and the gap between
consecutive apps (so the machine is not hammered all at once). - Workdays only? — default yes (Mon–Fri). Confirm whether weekends
should also launch. - Holidays to skip? — optional list of dates.
Step 2 — Write the config
Create/edit scripts/launcher-config.json (same directory as the scripts)
using the schema from assets/launcher-config.template.json:
{
"workdaysOnly": true,
"workdays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"holidays": [],
"initialDelaySeconds": 30,
"apps": [
{ "path": "C:\\Users\\HW\\Desktop\\WeChat.lnk", "args": "", "delayAfterSeconds": 5 },
{ "path": "C:\\Program Files\\Tencent\\QQ\\Bin\\QQ.exe", "args": "", "delayAfterSeconds": 10 }
]
}
Notes:
- Day names are English (Monday...Sunday).
- holidays entries are yyyy-MM-dd or MM-dd strings.
- Fill in the user's real username/path. Do not leave REPLACE_WITH_YOUR_USERNAME.
- args is optional; keep "" when not needed.
Step 3 — Register the scheduled task
Run the setup script with an absolute path via PowerShell:
powershell.exe -ExecutionPolicy Bypass -File "C:\Users\HW\.workbuddy\skills\windows-app-auto-launch\scripts\setup_auto_launch.ps1"
This creates/overwrites the WorkdayAppAutoLaunch task (logon trigger, current
interactive user). Re-running it safely updates the task.
Step 4 — Test, then hand off
Test immediately without waiting for the next logon:
powershell.exe -ExecutionPolicy Bypass -File "C:\Users\HW\.workbuddy\skills\windows-app-auto-launch\scripts\setup_auto_launch.ps1" -TestNow
-TestNow launches the apps right away (ignoring day rules) so the user can
confirm everything opens. If something fails, read the daily log at
%USERPROFILE%\auto_launch_logs\auto_launch_YYYY-MM-dd.log and consult
references/windows-task-scheduler.md.
Tell the user:
- The task name (WorkdayAppAutoLaunch) and that it runs at every logon.
- To add/remove apps or change delays, edit scripts/launcher-config.json
and re-run the setup command (or just Start-ScheduledTask to apply next boot).
- To remove automation:
powershell
powershell.exe -ExecutionPolicy Bypass -File "C:\Users\HW\.workbuddy\skills\windows-app-auto-launch\scripts\setup_auto_launch.ps1" -Uninstall
Gotchas
- Desktop apps must run in the user's interactive session: the task uses
LogonType = Interactive. Do not switch to a boot trigger or SYSTEM account
unless headless startup is truly intended (see reference doc). - The launcher and config are ASCII/UTF-8; Chinese characters in paths are
fine inside the JSON config (read with-Encoding UTF8). - Registering for the current user normally needs no admin rights; if denied,
run the setup once from an elevated PowerShell.