PacsSwitch can be run from the command line or a script, for example to activate a scenario from another scheduling tool, or to check the active scenario from a monitoring script. DTRS.exe -help prints the same list.

How to run a command

Run the commands from an elevated (administrator) Command Prompt or PowerShell, in the installation folder (for example C:\Program Files (x86)\PacsLogic\PacsSwitch). PacsSwitch is a Windows program, so the prompt can come back before the text appears. To wait for the output, start it like this:

start /wait "" DTRS.exe -list

No window opens. Every command is written to the application log with the Windows user who ran it.

Information (safe while the PacsSwitch window is open)

CommandWhat it does
-helpShows the list of commands.
-listLists the scenarios, one name per line.
-showShows the name of the active scenario.
-statsUpdates the status page files and deletes old logs (the DTRS Stats Updater task runs this).
-stats showPrints the latest index.txt status page without updating it.
-schedule, -schedule historyLists this server's scheduled changes, or the latest results.
-monitor start|stop|statusStarts, stops or checks the monitor.
-update status|cancel|revertSoftware updates: show the state, cancel a scheduled update, or go back one step.

Actions (refused while the PacsSwitch window is open on this server)

CommandWhat it does
-activate "<name>"Activates a scenario, by its name or file name, after the pre-flight check; for example DTRS.exe -activate "Backup/Contingency". The proxy service is reloaded if it runs.
-schedule add "YYYY-MM-DD HH:MM" "<scenario>" [-note "text"] [-force]Adds a one-time scheduled change. -force switches even if the pre-flight check finds errors.
-schedule add daily|weekdays|weekends HH:MM "<scenario>" [-note "text"] [-force]Adds a recurring scheduled change.
-schedule delete|pause|resume <id>For example -schedule pause L3.
-startproxy, -stopproxyStarts or stops the proxy (the service when it is installed). Stopping stops all routing.
-install, -uninstallInstalls the service and its scheduled tasks with the SYSTEM account, or removes them. A named account is set up in Settings > Services.
-convertserviceSwitches a service installed by version 4.0.121 or older from NSSM to DTRS_Service.exe: same service name, account and settings. A running service is restarted (routing stops for a few seconds). The 4.0.122 setup runs it by itself.

The pre-flight check runs before -activate and -startproxy; problems are printed and logged.

Started by Windows (not by hand)

-boot-notify (after a restart), -netmon with -installdir (the monitor), and -service-start / -service-stop (the service's notification emails) are run by the scheduled tasks and the service.

Exit codes

CodeMeaning
0Finished.
1Failed (-install, -startproxy, -stopproxy).
2Refused: the PacsSwitch window is open on this server, perhaps by another user. Close it and run the command again.

Related pages

This page was revised 2026-11-03.


← Appendix B. Log files and Windows Event Log IDsAppendix D. Support view →