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 exit Opus.
[ul][li]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.
[li]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:
[ul][li]“C:\Program Files\GPSoftware\Directory Opus\DOpusRT.exe” /dblclk=off[/li][/ul]
(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):
[ul][li]“C:\Program Files\GPSoftware\Directory Opus\DOpusRT.exe” /CMD Close PROGRAM[/li][/ul]
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:
[ul][li]ExitOpusAndWait.zip (750 Bytes)[/li][/ul]
[li]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:
[ul][li]“C:\Program Files\GPSoftware\Directory Opus\DOpusRT.exe” /runopus[/li][/ul]
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:
[ul][li]“C:\Program Files\GPSoftware\Directory Opus\DOpus.exe” noautolister[/li][/ul][/li][/ul]
Full information about the command-line arguments is in the manual.
Info about the different Opus EXE files is here.