Change
Create a task
The high-signal section. A new task that runs an interpreter, lives in the root folder, or fires at logon/boot is classic persistence — treat creates as events to investigate. Logs as Event 4698 and TaskScheduler 106.
schtasks /create /tn "Updater" /tr "c:\app.exe" /sc onlogon/sc is the schedule: minute, hourly, daily, weekly, onlogon, onstart, onidle, once, onevent.
schtasks /create /tn X /tr "powershell -enc ..." /sc onlogonA task whose /tr is powershell, cmd, wscript, mshta, or rundll32 — especially encoded — is almost always malicious persistence.
schtasks /create ... /ru SYSTEM/ru sets the run-as account. SYSTEM (needs admin) runs the payload as the highest-priv account — a privilege tell. /rp supplies a password.
schtasks /create ... /sc onstart /ru SYSTEMRun at every boot as SYSTEM — the most durable persistence combination.
schtasks /create ... /sc onevent /ec Security /mo "*[System[(EventID=4624)]]"Trigger on a Windows event (/ec channel, /mo XPath) — e.g. fire on each logon. A sneaky, less-watched trigger.
schtasks /create ... /sc minute /mo 5/mo = the modifier/interval — here "every 5 minutes." Short intervals on an odd task look like beaconing.
schtasks /create ... /xml task.xmlCreate straight from an XML definition — lets an attacker set fields the CLI flags don't expose. The XML is worth reading.
schtasks /create ... /f/f forces (overwrites an existing task with no prompt) — used to silently replace a legit task.