If you want to exit Opus from a batch file or script, there are commands to do that.Do not simply kill the DOpus.exe and DOpusRT.exe processes.
There is no need to and it risks corrupting your config data. Instead, use the commands below, or the menu items shown above, to cleanly
- Exiting and restarting Opus from another program or installer:
Opus supports the Restart Manager API, so programs and installers should use that if they need to stop and start Opus programmatically, the same as they would for Windows Explorer.
- Cleanly exiting Opus from a batch or script:
The RestartViaManager command-line tool can be used to shutdown and immediately restart DOpus.exe (but not DOpusRT.exe) via the Restart Manager API, if that is all you need to do. The tool runs synchronously so you will know Opus has finished restarting when the tool completes (unless there was an error).
For more complex needs, read on.
If DOpusRT.exe is running to provide desktop double-click functionality, tell it to exit with this command:
- "C:\Program Files\GPSoftware\Directory Opus\DOpusRT.exe" /dblclk=off
(Note that launching Opus itself will also launch DOpusRT.exe if needed, so there is not normally any need to re-launch DOpusRT.exe manually.)
To exit DOpus.exe itself, run the Close PROGRAM command via DOpusRT.exe (this is not a typo; you use DOpusRT.exe to send the command, not DOpus.exe):
- "C:\Program Files\GPSoftware\Directory Opus\DOpusRT.exe" /CMD Close PROGRAM
Note that the commands above run asynchronously. They dispatch requests to Opus and then exit without waiting for the requests to complete. If you need to wait until Opus has completely stopped running then you will need some additional logic. Here is one way to do it in VBScript:
- Restarting Opus from a batch or script:
If your script is running from an elevated context (UAC), you should restart Opus using DOpusRT.exe's /runopus argument, which ensures Opus does not run elevated:
- "C:\Program Files\GPSoftware\Directory Opus\DOpusRT.exe" /runopus
Otherwise, how you choose to restart Opus depends on which windows (if any) you want to (re-)appear. If you run DOpus.exe with no arguments then a window will always appear, even if Preferences specifies that nothing should at startup. To suppress that behaviour, run DOpus.exe with the noautolister argument:
- "C:\Program Files\GPSoftware\Directory Opus\DOpus.exe" noautolister
Full information about the command-line arguments is in the manual.
Info about the different Opus EXE files is here