Windows Misc (registry/accounts/wsl)
windows.misc
Protects against destructive Windows cmd operations: `reg delete`, `net user|localgroup /delete`, `sc delete`, `schtasks /delete`, `wsl --unregister` (destroys a WSL distro), and `robocopy /MIR` (mirror delete).
- 6blocking rules
- 4safe patterns
- 5High
- 1Medium
[packs]
enabled = ["windows.misc"]Evaluated when a command contains reg, REG, net, NET, sc, SC, schtasks, SCHTASKS, wsl, WSL.
Blocking rules
Each rule ID is windows.misc:<name>. Use it in allowlists and [policy.rules].
Highnet-account-deletenet user/localgroup /delete removes a user account or local group.
Explanation
`net user <name> /delete` deletes a local user account (and `net localgroup <name> /delete` a group). The account, its group memberships, and access are removed with no prompt; the user's profile/data can be orphaned. Safer alternatives: - net user <name>: review the account before deleting - Disable instead of delete: net user <name> /active:no
Highreg-deletereg delete removes registry keys/values, which can break apps or Windows.
Explanation
`reg delete <key>` removes a registry key and all of its values and subkeys; with `/f` it does so without confirmation. The registry holds app and OS configuration, so a wrong key can break software, services, or the boot path, and there is no Recycle Bin for the registry. Safer alternatives: - reg export <key> backup.reg: back up the key first (undo with `reg import`) - reg query <key>: confirm exactly what the key contains before deleting
Highrobocopy-mirrorrobocopy /MIR deletes destination files that are not present in the source.
Explanation
`robocopy <src> <dst> /MIR` (mirror) and `/PURGE` delete files and directories in the DESTINATION that do not exist in the source — the Windows equivalent of `rsync --delete`. A wrong destination, or a source that is missing/empty, wipes the destination's contents. Safer alternatives: - robocopy <src> <dst> /E: copy subdirectories WITHOUT deleting extras - Add /L to /MIR first: list what WOULD change without touching anything
Highsc-deletesc delete removes a Windows service.
Explanation
`sc delete <service>` permanently removes a Windows service registration. If it is a service something depends on, that software stops working until the service is reinstalled. Safer alternatives: - sc query <service>: confirm the service and its state first - sc stop <service> / sc config <service> start= disabled: disable reversibly instead
Highwsl-unregisterwsl --unregister irreversibly destroys a WSL distribution and its filesystem.
Explanation
`wsl --unregister <distro>` deregisters a WSL distribution and DELETES its entire filesystem — every file, package, and change inside that Linux environment is gone with no undo. It is a frequent footgun when a reset/restart was intended. Safer alternatives: - wsl --export <distro> backup.tar: back up the whole distro first - wsl --terminate <distro>: stop it without destroying it
Mediumschtasks-deleteschtasks /delete removes scheduled tasks.
Explanation
`schtasks /delete /tn <task> /f` removes a scheduled task with no prompt; `/tn *` can remove many at once. Deleting a task that maintenance, backups, or apps rely on silently stops that work from running. Safer alternatives: - schtasks /query /tn <task>: confirm the task first - schtasks /change /tn <task> /disable: disable reversibly instead of deleting
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
reg-querysc-querywsl-listschtasks-query