Backing up Directory Opus from a MS-DOS batch file

(My OS is Windows 7, 32-bit.) I created an MS-DOS batch file which I run each day and effortlessly backs up the customized configuration files of all my regularly used apps, to individual subfolders of my \Backup folder, which I then archive. The batch file replaces previous configurations stored so they are always current. I would like this batch file to include calling DOpus from the command line and include a backup switch so that the .OCB file created will be saved in the same directory as it usually is when I click Backup & Restore from within DOpus.

I looked up the manual but as far as I can see, the "MS-DOS Batch File" section refers to buttons running MS-DOS commands from within DOpus, or am I mistaken? I can't seem to find a section titled "Running Directory Opus from an MS-DOS command line", or similar. Searching the forum hasn't given me the answers I need. Can anyone suggest a syntax to do this?

Alternatively, I could include a command in my batch file to copy the contents of the %appdata%\Roaming\GPSoftware\Directory Opus folder, but this seems cruder.

Thanks again for your help.

An *.ocb-File is just a *.zip-File with the content of the %appdata%\Roaming\GPSoftware\Directory Opus folder.
To excute a DOpus-command from outside DOPus you can use dopusrt.exe /cmd:

"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /cmd Prefs Backup=all TO "D:\Mine\Backups\Opus\Opus Backup on {date|yyyy-MM-dd}"

Perfect! Big thanks, kundal

Well, whaddaya know... I fell for the old trick used by so many other apps. Rename .ocb to .zip and WinZip, WinRar, etc. will happily extract its contents.

Didn't discover DopusRT.exe till you mentioned it. RT? what a strange acronym. Real Time? Runs and Terminates? Would like to know its derivation, out of interest.

May I suggest that the v10 manual include a separate chapter titled "Running Directory Opus from the MS-DOS command line", with plenty of syntax examples?

(Added) The only nuisance about doing it this way is that the backup window remains open when finished, requiring you to click Finish or press Enter before the batch file can complete and exit:

To get around this, add QUIET/S to the command, like this:

(line in external backup batch file:)

"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /cmd Prefs Backup=all TO "C:\ACTIVE\Backup\Config\Directory Opus\Opus Backup {date|yyyy-MM-dd}" QUIET/S 

Frankly, I have no idea what switches such as /K and /S in Prefs and Internal Commands do, and wish someone would explain the meaning of each. I checked Prefs - Raw Command and Internal Commands Summary in the v9 manual, but no joy.

I should stress the importance of the position of the second pair of quotation marks:

"...Directory Opus\Opus Backup {date|yyyy-MM-dd}" QUIET/S is CORRECT.

Contrary to what you might imagine,

"...Directory Opus\Opus Backup" {date|yyyy-MM-dd} QUIET/S
or
"...Directory Opus\Opus Backup {date|yyyy-MM-dd} QUIET/S "

won't cut it.

Page 206 of the manual under Opus Raw Commands - the switches are all defined.

Qualifiers. The list below shows the various qualifiers that options may use. You do not enter the qualifier when
you are using an option - it exists simply to indicate the type of the option.

/S Switch. Indicates a binary switch qualifier. The switch will be set if the option appears in the command-
line.

/O Switch with optional arguments. The same as /S but takes optional arguments where the default action
can be modified. For example, Copy takes an option UPDATEEXISTING, which may have none,
size or date as a qualifying parameter.

/K Keyword. This means that the option will not be accepted unless the keyword appears. For example if
the template is “Name/K”, then unless “Name=“ or “Name “ appears in the command
line, Name will not be accepted.

/A Required. This keyword or a value for it must be supplied, or else the entire command line will be
invalid.

/M Multiple strings. This means the argument will take any number of strings. Any arguments not
considered to be part of another option will be added to this option.

Options types other than /S (switches) require a value. This is usually given in the form OPTION or
OPTION=. The equals sign (=) is usually optional - either a space or an equals sign serves to separate the
option from its value. The one exception to this rule is when the value provided is the same as another option in the
template. In this instance, the = is required in order to indicate that it is the value you are providing, and not another
option.

Regards, AB

Assuming Opus is in private configuration mode (Preferences / Miscellaneous / Options). If it's in shared configuration mode then the settings you want will be in a different place (the two config-backup FAQs have more info).

Sorry to bump an old topic, but I want to point out that I can manually backup the entire appdata\roaming dataset for DO using 7-zip and end up with a file that is only 27Kb vs the "dopusrt.exe" method which results in a file of 87Kb.

Do u see any problem with that strategy?

Please don’t ask the same question in multiple threads, especially old ones. It means we have to repeat the answer, or leave it looking like we didn’t answer, and then any followup conversation will be scattered around different threads and hard for other people to find.


If you’re manually compressing the config folder, you may be backing up stale data (if Opus is still running) or not backing up everything (if you want the things in the local config folder).

Those are more important considerations than saving 60KB of space (barely enough for a small icon these days).

1 Like