Skip to content

Command Line Reference

Randy Northrup edited this page Nov 8, 2026 · 2 revisions

Command-Line Reference

otw.exe is the command-line tool. After an MSI install it is on the PATH as otw (open a new terminal first). From a portable copy, run it from the cli folder.

Every command takes --help (or -h, -?) for its options. otw --version prints the version.

otw --help
otw updates pause --help

Items marked (new in v0.3.0) need v0.3.0 or later. See Home.

Contents

Group Commands
Machine doctor, health, users, check-update
Catalogue and profiles catalog, profile
Scan, apply and undo scan, apply, remediate, revert, history
Audits audit
Windows Update updates
Automation task, eventlog
Startup and activity startup, access, watch

Exit codes

Exit codes are a contract: values never change once released. otw --help lists them.

Code Name Meaning
0 Success The command completed. For scan, the machine is compliant.
1 Drift scan found drift; audit run found failing rules; watch diff found changes
2 Error The command failed. Details are on stderr and in the audit log.
3 Unsupported OS Not a supported Windows 11 client build (see otw doctor)
4 Invalid input A bad argument, profile, catalogue or baseline, including a mistyped command line
5 Elevation required The command needs an elevated (administrator) terminal
6 Managed Nothing was changed because MDM or Group Policy manages the setting (new in v0.3.0)
3010 Reboot required Changes were applied; a reboot completes them (the same value Windows Installer uses)

Two rules apply to every command:

  • A mistyped command line prints the parser's message and Run 'otw --help', or 'otw <command> --help', for usage. and exits with 4.
  • An unexpected failure prints Unexpected error (<type>): <message> and exits with 2.

The tables below list the codes each command returns in normal use.

Common ideas

Elevation. Commands that change the machine need an elevated terminal and exit with 5 without one. Their --what-if preview never needs elevation. A few reads also need elevation: a scan at the balanced level or above reads the local password and lockout policy with secedit, which only works elevated.

Profiles. scan, apply, remediate and task install take --profile, which accepts:

Value Meaning
basic, balanced, strict, paranoid A level applied to every category. Verified entries only, unless --include-draft.
developer, enterprise-workstation, gamer, home, kiosk-shared, power-user, privacy-max A built-in profile (see otw profile list and Profiles)
A path to a .json file Your own profile file

JSON. Most commands take --json for scripting. Their help marks the output as a stable schema, so scripts can rely on it.

Catalogue directory. --catalog-dir <dir> loads extra catalogue JSON files; their entries override built-in ones with the same id. The same code-level safety rules apply to them, and the RequireSignedProfiles policy requires them to be signed.


otw doctor

Checks that the machine is supported and whether the session is elevated. Elevation does not change the exit code.

otw doctor [--json]
Option Description
--json Emit the report as JSON
otw doctor
Open the Windows 0.3.0

OS:        Windows 11 Pro 25H2 (build 26200.9711, x64)
Edition:   Professional / Client
User:      <computer>\<user> (not elevated)
Status:    Supported
Can apply: no

  - Not running elevated. Read-only operations (scan, report) work; apply and revert require administrator rights.

Status is Supported, UnsupportedWindowsVersion (older than build 22000) or UnsupportedServerSku (Windows Server).

Exit When
0 Supported
3 Not supported

otw catalog

Inspects and validates the tweak catalogue. Read-only.

--catalog-dir <dir> and --json can be given to any catalog subcommand.

otw catalog list

otw catalog list [--category <category>] [--level <level>] [--catalog-dir <dir>] [--json]
Option Description
--category Only entries in Privacy, Updates, Security, Performance, Debloat or Shell
--level Only entries at or below this level: Basic, Balanced, Strict or Paranoid (Off lists none)
otw catalog list --category Updates --level Basic
ID                               CATEGORY    LEVEL    RISK     STATUS     TITLE
updates.microsoft-update.enable  Updates     Basic    Safe     Verified   Get updates for other Microsoft products
1 entries.

otw catalog show

otw catalog show <id> [--catalog-dir <dir>] [--json]

Shows one entry: category, level, risk, scope, status, description, rationale (Why), restart need, applicability, actions, side effects, the MDM/Group Policy setting that manages it, sources and verification record.

otw catalog show privacy.diagnostic-data.required-only
privacy.diagnostic-data.required-only  [Privacy / Basic / Safe / Machine / Verified]
Limit diagnostic data to Required

Sets the diagnostic data policy to Required (formerly Basic) so Windows sends only the data needed to keep the device secure and up to date, instead of Optional data (app usage, browsing, inking and typing).

Why: Required is the lowest level honoured on Home and Pro; 'Diagnostic data off' (0) is only honoured on Enterprise, Education and IoT. Windows Update, Defender and Store keep working at Required.
Requires: None
Actions:
  - Registry: RegistryAction { Hive = LocalMachine, Path = SOFTWARE\Policies\Microsoft\Windows\DataCollection, Name = AllowTelemetry, Type = Dword, Value = 1, Default = , ValueKind = Policy, Kind = Registry }
Managed by: CSP System/AllowTelemetry; GPO Computer Configuration\Administrative Templates\Windows Components\Data Collection and Preview Builds\Allow Diagnostic Data
Sources:
  - https://learn.microsoft.com/windows/privacy/configure-windows-diagnostic-data-in-your-organization
  - https://learn.microsoft.com/windows/client-management/mdm/policy-csp-system
Verified on: 26200 Pro 2026-08-17

otw catalog validate

otw catalog validate [--catalog-dir <dir>] [--json]

Validates the built-in catalogue, plus --catalog-dir, against the schema and the structural and safety rules.

otw catalog validate
Catalogue valid: 455 entries, 0 warning(s).
Exit (all catalog subcommands) When
0 Success
4 Invalid catalogue, invalid or unknown entry id

otw profile

Inspects, validates, signs and captures profiles. --json works with list, show and validate. See Profiles for the file format and signing.

otw profile list

otw profile list
ID                      NAME                    SCOPE     DESCRIPTION
developer               Developer               User      Developer workstation. Balanced privacy and security that will not interfere with tooling, with performance tuned up and the shell kept usable.
enterprise-workstation  Enterprise Workstation  AllUsers  Managed corporate device. Strict privacy and security hardening, updates kept controllable but not aggressive, applied to every user on the machine.
gamer                   Gamer                   User      Gaming desktop. Maximum performance and heavy debloat, privacy kept balanced and updates near default so anti-cheat and drivers keep working.
home                    Home                    User      Everyday consumer PC. Sensible privacy and cleanup with zero functional loss the household would notice; updates stay close to default.
kiosk-shared            Kiosk / Shared          AllUsers  Locked-down shared or single-purpose device. Strict privacy, security and debloat with a minimal shell, applied to every user including future ones.
power-user              Power User              User      Enthusiast single-user desktop. Strong privacy, aggressive performance and a decluttered shell, accepting minor, well-understood trade-offs.
privacy-max             Privacy Max             User      Privacy above convenience. Every non-breaking telemetry, cloud and tracking control on, with strong security and debloat; expect some cloud features to stop working.
7 profiles.

otw profile show

otw profile show <profile> [--json]

<profile> is a built-in id or a path to a profile file. Shows the level dial, include and exclude lists, Draft setting, options and applicability.

otw profile show home
home  [Home / scope User]
Everyday consumer PC. Sensible privacy and cleanup with zero functional loss the household would notice; updates stay close to default.

Levels: Privacy=Balanced Updates=Basic Security=Balanced Performance=Balanced Debloat=Basic Shell=Basic
Include: -
Exclude: -
Include draft: False
Options: restorePoint=True, restartExplorer=True, allowAdvanced=False, allowBreaking=False
Applies to: editions [], builds *..*, arch []

otw profile validate

otw profile validate <profile> [--catalog-dir <dir>] [--json]

Validates a profile against the schema and the catalogue: referenced ids must exist, and built-in profiles may never include or allow Breaking entries.

otw profile validate home
Profile 'home' valid: 0 warning(s).

otw profile sign

otw profile sign <profile> --key <pem> [--out <file>]
Option Description
--key Required. PEM file holding the ES256 (P-256) private key
--out Where to write the detached signature (default <profile>.sig)

Refuses to sign a profile that fails validation.

otw profile sign .\team.json --key .\signing-key.pem
Signed '.\team.json' -> '.\team.json.sig' (keyId 7c604ebd94a35b2642335fa1e444a315c08791cf61db71590148d7e561694c18).

otw profile verify

otw profile verify <profile> [--key <pem>] [--sig <file>]
Option Description
--key PEM public key to verify against (default: the machine trust store, %ProgramData%\OpenTheWindows\trusted-keys)
--sig Path to the detached signature (default <profile>.sig)
otw profile verify .\team.json --key .\signing-key.pub.pem
Signature valid (alg ES256, keyId 7c604ebd94a35b2642335fa1e444a315c08791cf61db71590148d7e561694c18).
Exit (list, show, validate, sign, verify) When
0 Success
4 Unknown profile, unreadable file, failed validation, bad key, or a signature that does not verify

otw profile capture

New in v0.3.0.

otw profile capture --out <file> [--id <id>] [--name <name>] [--include-draft]

Writes a profile of the catalogue settings this PC already has, so you can apply the same configuration to other PCs. It scans only; nothing on this PC changes. Run it from an elevated terminal: some of the settings it reads need administrator rights.

Option Description
--out Required. Where to write the profile .json
--id Profile id: lower-case letters, digits and hyphens (default captured-<yyyyMMdd>)
--name Display name (default Captured from <computer>)
--include-draft Also consider Draft entries (Verified only by default)
otw profile capture --out .\reference-pc.json --id reference-pc --name "Reference PC"

The output is Wrote profile '<id>' to <file>: <n> setting(s) of <m> scanned were already in place.

Exit When
0 Written
2 Error
3 Unsupported OS
4 Invalid --id

otw scan

Read-only drift scan: how far this PC is from a level, a built-in profile or a profile file. Nothing is changed.

otw scan --profile <profile> | --only <id> [options]
Option Description
--profile A level, a built-in profile id or a profile file (required unless --only)
--catalog-dir Extra catalogue files
--include-draft Include Draft entries. Applies to levels; a named profile carries its own setting.
--only Scan only this entry id (plus the entries it depends on); includes Draft
--json Write a JSON report
--csv Write a CSV report
--html Write a self-contained HTML report
--sarif Write a SARIF 2.1.0 report
--out Write the report to this file instead of stdout (JSON when no format is given)

Choose at most one report format. Without one, a text summary lists each drifted entry.

otw scan --only privacy.diagnostic-data.required-only
Profile 'only:privacy.diagnostic-data.required-only' on Windows 11 Pro build 26200.9711
1 entr(y/ies): 0 compliant, 1 drift, 0 managed.
  DRIFT  privacy.diagnostic-data.required-only
Drift detected.
otw scan --profile home --html --out .\home-scan.html
Exit When
0 Compliant (no drift)
1 Drift found
2 Error, including more than one report format
3 Unsupported OS
4 Unknown profile, a profile refused by the signing policy, or an unknown --only id

otw apply

Applies a level, a built-in profile or a profile file, transactionally. Every prior value is journaled first and each change is re-read to verify it; a failed step rolls the whole run back. See Safety and Reversibility.

otw apply --profile <profile> | --only <id> [options]
Option Description
--profile A level, a built-in profile id or a profile file (required unless --only)
--catalog-dir Extra catalogue files
--include-draft Include Draft entries (levels only; a named profile carries its own setting)
--only Apply only this entry id, plus the entries it depends on; includes Draft
--what-if Plan only; change nothing (no elevation needed)
--no-restore-point Do not request a System Restore point first (one is requested by default)
--break-glass Apply even over settings MDM or Group Policy manages (audited as Event 4001)
--allow-advanced Permit Advanced-risk entries
--allow-breaking Permit Breaking-risk entries. Each one also needs its id typed unless --yes.
--yes Assume yes to confirmations (unattended)
--restart-explorer Restart Explorer for entries that need it
--json Emit the result as JSON

A built-in or file profile's own options (restore point, Explorer restart, allow Advanced or Breaking) are the defaults; the flags can only turn behaviour on, except --no-restore-point.

When Breaking entries are confirmed, the prompt goes to stderr: Breaking change '<id>'. Type the id to confirm:. A --json run cannot prompt, so it must carry --yes when it includes Breaking entries.

otw apply --profile home --what-if
otw apply --profile privacy-max
otw apply --profile strict --allow-advanced
otw apply --only security.crypto.disable-tls-10 --allow-breaking

The text output lists each entry with its result, then a summary line:

  Pending       shell.explorer.classic-context-menu
  Pending       updates.microsoft-update.enable
Would apply: Completed. Restart requirement: Reboot. Restore point: NotRequested.

Entry results are Pending (would apply, in a preview), Applied, Skipped (already in place, or blocked, with the reason in parentheses), Managed, NotApplicable, Refused, Failed, RolledBack and NotReversible. Pre-flight problems print as BLOCKED <check>: <detail>.

apply, remediate, revert, startup enable|disable and updates target share one JSON report shape:

Property Contents
runId The journaled run id (empty for a preview or a rejected plan)
state Completed, RolledBack or Failed
requires The run's restart requirement: None, ExplorerRestart, SignOut or Reboot
restorePoint status (Created, Skipped24h, Disabled, Failed or NotRequested) and sequenceNumber
errors Plan errors and blocking pre-flight checks
entries One object per entry: id, result, risk, requires, note
Exit When
0 Applied, nothing to do, or a successful --what-if
2 The run failed or was rolled back, or a pre-flight check blocked it
3 Unsupported OS
4 Unknown profile, plan errors (conflicting entries, dependency cycle, another run holding the lock), or a Breaking confirmation that did not match
5 Not elevated
3010 Applied; a reboot is required

otw remediate

The unattended form of apply, for scheduled tasks and Intune: it scans, then applies only the drifted entries. It never prompts and never overrides a setting MDM or Group Policy manages.

otw remediate --profile <profile> [options]
Option Description
--profile A level, a built-in profile id or a profile file
--catalog-dir Extra catalogue files
--include-draft Include Draft entries (levels only)
--what-if Plan only; change nothing
--no-restore-point Do not request a System Restore point (a profile may also opt out)
--allow-advanced Permit Advanced-risk entries (a profile's own option also enables these)
--allow-breaking Permit Breaking-risk entries (a profile's own option also enables these). No typed confirmation is asked.
--restart-explorer Restart Explorer for entries that need it
--user-scope Apply only the profile's per-user entries to the calling user's own registry hive, without elevation. The all-users logon fallback runs this at sign-in.
--if-build-changed Re-apply only when the Windows build or update revision differs from this profile's last completed run (a profile never applied before is applied); otherwise exit 0 without changes
--json Emit the result as JSON (implied by --out)
--out Write the JSON report to this file
otw remediate --profile enterprise-workstation --json --out C:\ProgramData\OpenTheWindows\reports\last-remediate.json

When nothing changed because of --if-build-changed, it prints OS build unchanged (<build>); '<profile>' not re-applied.

Exit When
0 Compliant, applied, or nothing to do
2 Error, or the run failed or was rolled back
3 Unsupported OS
4 Unknown or refused profile, or plan errors
5 Not elevated (unless --what-if or --user-scope)
3010 Applied; a reboot is required

otw revert

Restores the state captured before a prior run. The revert is itself journaled. See Safety and Reversibility.

otw revert <run> [--entry <id>]... [--what-if] [--force] [--restart-explorer] [--json]
otw revert --all [--what-if] [--force] [--restart-explorer]
Argument or option Description
<run> A run id (GUID) from otw history, or last for the most recent apply run whose journal verifies (never a revert run)
--entry Revert only this entry of the run. Repeat it for more entries. (new in v0.3.0)
--all Undo everything: revert every run this product made that is not already reverted, newest first. Not combined with <run> or --entry. (new in v0.3.0)
--what-if Plan only; change nothing
--force Revert even if the run was already reverted or a later run changed the same settings (overwriting them) (new in v0.3.0)
--restart-explorer Restart Explorer for entries that need it
--json Emit the result as JSON (single run only)
otw revert last
otw revert last --entry shell.explorer.classic-context-menu
otw revert --all --what-if

A refused revert prints the reason per entry and Revert of run <id> refused; nothing was changed. --all prints one line per run and ends with Every change this product made has been reverted. or <n> run(s) could not be reverted; see above.

Exit When
0 Reverted (every run, for --all)
2 Refused, failed, or a journal that does not verify
3 Unsupported OS
4 Not a run id or last, no verified run, an unknown run, or --all combined with a run or --entry
5 Not elevated

otw history

Lists prior apply and revert runs from the machine journal, newest first. Read-only.

otw history [--json]

Each line shows the start time, the run id, the label (profile, level or feature), the result, the entry count, and apply or revert of <run id>. --json adds each journal's integrity (Verified, Unverified, Tampered or Unreadable).

otw history --json
Exit When
0 Success (also when no runs are recorded)

otw audit

Scores the machine against security baselines and validates baseline files. Read-only; no elevation needed, though some health checks report Unknown without it. See Security Baseline Audits.

otw audit list

otw audit list
ID                  RULES  TITLE
cis-win11-ent-v4.0     16  CIS Microsoft Windows 11 Enterprise Benchmark v4.0.0
disa-stig-v2r7         16  DISA Microsoft Windows 11 STIG V2R7
ms-baseline-25h2       16  Microsoft Windows 11 Security Baseline (25H2)

otw audit run

otw audit run --baseline <id|file> [--catalog-dir <dir>] [--json|--csv|--html|--sarif] [--out <file>] [--sign <pem>]
Option Description
--baseline Required. A baseline id from otw audit list, or a path to a baseline file
--catalog-dir Extra catalogue files
--json JSON report with an integrity hash (add --sign to sign it)
--csv CSV report, one row per rule
--html Self-contained HTML report: score, summary and per-severity tables
--sarif SARIF 2.1.0 report; rule ids are the baseline rule ids
--out Write the report to this file (JSON when no format is given)
--sign Sign the JSON report with the ES256 private key in this PEM file (JSON only)
otw audit run --baseline disa-stig-v2r7 --html --out .\stig.html

Without a format, a text summary prints the score, the counts and each failing rule.

Exit When
0 No failing rules
1 At least one rule failed
2 Error, more than one format, or --sign with a non-JSON format
3 Unsupported OS
4 Unknown or invalid baseline, or an unreadable signing key

otw audit validate

otw audit validate [--catalog-dir <dir>] [--baseline-dir <dir>] [--json]

Validates the built-in baselines, plus those in --baseline-dir (which override built-in ones by id), against the schema, the catalogue ids and the health-check ids.

otw audit validate
Baselines valid: 3 baseline(s), 48 rule(s), 0 warning(s).
Exit (list, validate) When
0 Success
4 Invalid baselines (validate)

otw health

Runs read-only machine health checks. Nothing is changed.

otw health [--json]

Each line is [<status>] <check>: <detail>, with status Pass, Fail, Warn, Unknown or NotApplicable. Run it elevated: some checks (TPM, BitLocker, Windows Recovery Environment, the Security event-log size and the local security policy) report Unknown without administrator rights.

The checks: Defender real-time protection, Tamper Protection, Secure Boot, TPM present and ready, BitLocker on the OS volume, virtualisation-based security, LSA protection (RunAsPPL), Kernel DMA protection, Windows build in support, local administrators, device join state, Windows Hello enrolment, firewall on all profiles, Remote Desktop exposure, SMB hardening, remote-management services, Sudo and Developer Mode, Smart App Control / WDAC, vulnerable-driver blocklist, core isolation (HVCI), supported Windows edition, Windows Recovery Environment, host and port-proxy exposure, Security event-log size, Defender exclusions, local security policy snapshot, registered antivirus products, and MDM enrolment.

otw health
Exit When
0 The checks ran (whatever their results)

otw updates

Pause, resume and inspect Windows Update with guardrails. Full details are on Windows Update Control.

otw updates pause

otw updates pause --days <n> [--extended] [--what-if]
Option Description
--days Required. Days to pause: 1 to 35, or up to 365 with --extended (an administrator can lower that limit by policy)
--extended Allow a pause beyond Microsoft's 35-day cap (Advanced risk; writes Event 4002)
--what-if Plan only; change nothing
otw updates pause --days 14

The output is Paused Windows Update for 14 days, until <yyyy-MM-dd HH:mm> UTC. An extended pause also prints a warning on stderr.

Exit When
0 Paused (or previewed)
2 The pause failed
3 Unsupported OS
4 Days out of range, including a re-pause that would exceed the limit
5 Not elevated
6 Windows Update is managed by MDM or Group Policy; nothing changed (new in v0.3.0)

otw updates resume

otw updates resume [--what-if]

Clears every pause this tool set and triggers an update scan. It also ends a pause set in the Settings app (new in v0.3.0).

otw updates resume
Exit When
0 Resumed, or not paused
2 Could not clear the pause
3 Unsupported OS
5 Not elevated

otw updates status

otw updates status [--json]

Shows the running version, end-of-servicing date, pause state and any feature-update hold. --json is new in v0.3.0.

otw updates status
Windows 25H2 (Professional, Consumer servicing)
End of servicing: 2027-10-12 (in 338 day(s))
Updates not paused.
Exit When
0 Success
3 Unsupported OS

otw updates hidden

otw updates hidden [--json]

Lists the updates the Windows Update Agent currently has hidden, as <KB ids> <title>.

otw updates hide / unhide

otw updates hide --kb <id> [--what-if] [--json]
otw updates unhide --kb <id> [--what-if] [--json]
Option Description
--kb Required. Knowledge-base id, written KB5063878 or 5063878
--what-if Report how many discovered updates would change; change nothing; no elevation needed (new in v0.3.0)
--json Emit the outcome as JSON (new in v0.3.0)
otw updates hide --kb KB5063878 --what-if
otw updates hide --kb KB5063878
Exit (hidden, hide, unhide) When
0 Success
2 The update was not found or did not take the new state
3 Unsupported OS
4 Not a valid KB id
5 Not elevated (hide, unhide, unless --what-if)

otw updates target

New in v0.3.0.

otw updates target --version <version> [--what-if] [--json]
otw updates target --clear [--what-if]
otw updates target --list
Option Description
--version The Windows 11 version to hold feature updates at, for example 24H2
--clear Remove the hold so newer feature updates are offered again
--list List the versions this device can be held at
--what-if Plan only; change nothing
--json Emit the result as JSON
otw updates target --list
otw updates target --version 25H2
23H2
24H2
25H2
26H1
Exit When
0 Held, cleared, nothing to clear, or listed
2 The change failed
3 Unsupported OS
4 Neither or both of --version and --clear, an unknown version, or Windows Home
5 Not elevated
6 Windows Update is managed by MDM or Group Policy; nothing changed

otw updates repair

New in v0.3.0.

otw updates repair [--what-if] [--json]

Resets a stuck Windows Update client: stops its services for the repair only, renames the download cache and catroot2 aside, and starts the services again. --what-if lists the steps.

otw updates repair --what-if
Exit When
0 Repaired (or previewed)
2 A step failed (Repair stopped: <reason> on stderr)
3 Unsupported OS
5 Not elevated

otw task

Installs or removes the scheduled tasks. See Enterprise Deployment.

otw task install

otw task install --profile <profile> [--daily|--weekly|--on-logon|--on-build-change] [--what-if]
otw task install --audit <baseline-id> --out <path> [--daily|--weekly|--on-logon|--on-build-change] [--what-if]
Option Description
--profile Register the remediation task (\OpenTheWindows\Remediate) for a level, built-in profile or profile file
--audit Register the audit task (\OpenTheWindows\Audit) for a built-in baseline id instead; needs --out
--out For an audit task: where the JSON report is written (for example a UNC share)
--daily Run once a day (the default)
--weekly Run once a week
--on-logon Run at every user logon
--on-build-change Run at system start, re-applying only after a feature update (a build or update-revision change)
--what-if Show the task that would be registered (path, trigger, account and command line); change nothing; no elevation needed (new in v0.3.0)

Both tasks run as SYSTEM with highest privileges and are hidden. An existing task of the same name is replaced. The command refuses an otw.exe that a non-administrator could change, and copies a profile file to %ProgramData%\OpenTheWindows\profiles first.

otw task install --profile enterprise-workstation --weekly
otw task install --profile enterprise-workstation --on-build-change --what-if
Exit When
0 Installed (or previewed)
2 The executable's location is not protected, or its path is unknown
3 Unsupported OS
4 Both --profile and --audit, more than one trigger, an unknown profile or baseline, or --audit without --out
5 Not elevated

otw task remove

otw task remove [--what-if]

Removes the remediation task (\OpenTheWindows\Remediate) and every per-user logon fallback component an all-users apply registered. It does not remove the audit task. --what-if (new in v0.3.0) reports whether the task is there and how many logon fallback components would go, changes nothing and needs no elevation.

otw task remove --what-if
otw task remove
Exit When
0 Removed, or nothing to remove
3 Unsupported OS
5 Not elevated (unless --what-if)

otw eventlog

Registers or removes the Event Log source (log OpenTheWindows, source OTW). The MSI runs install and uninstall for you.

otw eventlog install
otw eventlog uninstall
otw eventlog status [--json]
otw eventlog status
Event Log source 'OTW' in log 'OpenTheWindows': registered.

status --json is new in v0.3.0.

Exit When
0 Success (install is safe to repeat)
2 The source could not be registered or removed
3 Unsupported OS
5 Not elevated (install, uninstall)

otw users

Lists the user profiles an all-users apply would target, and whether each one's registry hive is currently loaded. Read-only.

otw users [--json]

Each line is <SID> loaded|not loaded <profile path>.

Exit When
0 Success

otw startup

New in v0.3.0.

Lists the apps Windows starts at sign-in, and turns one on or off with the same switch Task Manager uses. See Startup Apps, App Access and Persistence Watch.

otw startup list [--json]
otw startup enable <name> [--location <location>] [--what-if] [--json]
otw startup disable <name> [--location <location>] [--what-if] [--json]
Argument or option Description
<name> The app's name as otw startup list shows it (not case-sensitive)
--location Which registration to change when the name appears in more than one place: MachineRun, MachineRun32, MachineStartupFolder, UserRun or UserStartupFolder
--what-if Show what would change; change nothing
--json Emit the result as JSON

list prints on or off, the location, the name and the command line for each app.

otw startup list
otw startup disable "Docker Desktop"
Exit When
0 Listed, or changed
2 The change failed
3 Unsupported OS
4 No app by that name, or the name is in several places and --location was not given
5 Not elevated (enable, disable, unless --what-if)

otw access

New in v0.3.0.

Shows which apps recently used the camera, microphone or location, and which are using one right now. Read-only.

otw access [--all] [--json]
Option Description
--all Every capability Windows records, not only camera, microphone and location
--json Emit the list as JSON

Each line is <capability> <time or "in use now"> <app>. Capability names are the ones Windows records, such as webcam, microphone and location.

otw access --all
Exit When
0 Success
3 Unsupported OS

otw watch

New in v0.3.0.

Records every autostart as a baseline, then lists what changed since. Read-only apart from the baseline file. Both subcommands need an elevated terminal, so they see the same set.

otw watch snapshot [--json]
otw watch diff [--json]
otw watch snapshot
otw watch diff

snapshot prints Recorded <n> autostarts as the baseline. diff prints the baseline time and the number of changes, then each change as Added, Removed or Changed, its kind (Service, ScheduledTask, RunKey or StartupFolder), its key, and what it runs.

Exit When
0 Baseline recorded, or no changes
1 diff found changes
2 diff with no baseline yet
3 Unsupported OS
5 Not elevated

otw check-update

Opt-in: makes one HTTPS request to GitHub Releases for a newer version. Nothing else uses the network, and nothing runs on a schedule.

otw check-update [--json]
otw check-update
Running 0.2.0; GitHub latest is 0.2.0.
Exit When
0 The check succeeded (whether or not a newer version exists)
2 GitHub could not be reached or the reply could not be read

Clone this wiki locally