Drop Task Scheduler; autostart without administrator rights
Register-ScheduledTask failed with Access denied (0x80070005). Writing to the root task folder needs elevation, so the claim that this install needed no admin was simply wrong. Rather than demand UAC, use two mechanisms that need no privileges at all: - a Startup-folder entry (AutoFirmer.cmd) runs start-all.bat at logon - PM2's own --cron-restart with --no-autorestart drives the 5-minute update check, so PM2 owns the schedule it was already going to resurrect anyway Both still run in the logged-in interactive session, which is the requirement that ruled out a Windows service in the first place: the clicker sends real input and needs a desktop. pm2 save now runs after the updater is registered, so `pm2 resurrect` brings back all three processes rather than two. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
7e4714c33d
commit
724ba5581c
@@ -161,10 +161,10 @@ or after declining:
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\install-autostart.ps1
|
||||
```
|
||||
|
||||
That registers PM2 for both processes and two scheduled tasks — one to start
|
||||
everything at logon, one to check `master` for updates every 5 minutes. It needs
|
||||
no elevation and is safe to re-run; it replaces the tasks rather than stacking
|
||||
them up.
|
||||
That puts the dashboard, the clicker and an update checker under PM2, adds a
|
||||
Startup-folder entry so PM2 comes back at logon, and lets PM2's cron restart run
|
||||
the update check every 5 minutes. It needs no administrator rights, changes
|
||||
nothing machine-wide, and is safe to re-run.
|
||||
|
||||
```powershell
|
||||
pm2 list # what is running
|
||||
@@ -172,11 +172,14 @@ pm2 logs autofirmer # dashboard output
|
||||
pm2 logs clicker # runner output
|
||||
```
|
||||
|
||||
**Why scheduled tasks and not a Windows service.** The clicker sends real mouse
|
||||
and keyboard input and has to own a desktop. A service runs in session 0, which
|
||||
has none, so the clicks would go nowhere. Both tasks therefore run as you with
|
||||
"run only when user is logged on" — which also means an unattended reboot leaves
|
||||
the instance down until somebody logs in.
|
||||
**Why not a Windows service.** The clicker sends real mouse and keyboard input
|
||||
and has to own a desktop. A service runs in session 0, which has none, so the
|
||||
clicks would go nowhere. Everything therefore runs in your logged-in session —
|
||||
which also means an unattended reboot leaves the instance down until somebody
|
||||
logs in.
|
||||
|
||||
To stop it starting at logon, delete the `AutoFirmer.cmd` shortcut from your
|
||||
Startup folder (`shell:startup` in the Run dialog).
|
||||
|
||||
To start everything by hand without waiting for a logon:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user