CLI Reference
The AppProfileSafe CLI (AppProfileSafe.CLI.exe) provides the same export, import, and reporting functionality as the GUI in a dedicated command-line executable designed for automation. It supports batch scripts, scheduled tasks, SCCM task sequences, Intune remediation scripts, and GPO logon/logoff scripts.
Operation Modes
| Mode | Flag | Description |
|---|---|---|
| Export | --export |
Export application settings (files, registry, folders) to a manifest-based backup |
| Import | --import |
Import application settings from a manifest-based backup to the target machine |
| Compliance Report | --generateComplianceReport |
Generate an HTML compliance report from audit log data for a date range |
| Preflight | --preflight |
Validate all prerequisites without performing any operations; produces a JSON report. Combine with --export or --import to select which checks to run (defaults to export if omitted) |
Each mode only accepts its own set of parameters. Passing a parameter that does not belong to the active mode (e.g. --mappingFile with --export) results in an error. Unrecognized parameters are also rejected. See Full Parameter Reference for per-mode parameter lists.
Requirements
The CLI requires administrator privileges. If the process is not elevated, it exits immediately with exit code 2. This check runs before argument parsing, so the --silentMode flag has no effect on the error message.
A valid license is required for export and import operations — there is no trial mode in the CLI. If the license is missing, invalid, or expired beyond the grace period, the CLI exits with code 3. Preflight mode skips the license gate in the main flow but validates the license internally as part of its checks.
Only one instance of AppProfileSafe (GUI or CLI) can run at a time. A second instance exits with code 2. This message is always written to stderr, even in silent mode.
Console Output
By default, the CLI writes progress to the console in pipe-delimited format:
App|Type|Source|Destination|Result
Types are Operation, Registry, or File. Results are Success, Error, or Skipped.
Validation errors and runtime errors are written to stderr, followed by the full help text. Use --silentMode to suppress all console output — errors and help text are then only recorded in the application log.
Help output (-h / --help) is written to stdout and always exits with code 0.
Topics in This Section
- CLI Command Overview — Usage patterns for export, import, compliance reports, and preflight
- Full Parameter Reference — All parameters with types, defaults, and mode applicability
- Exit Codes — Numeric exit codes and their meanings for scripted error handling
- Silent Mode Behavior — How
--silentModeaffects output, logging, and error reporting