a comparison project on the command line.
Starting from version
1.90, AdeptSQL Diff supports a number of start-up parameters on the
command line. The
parameter you'd most commonly use is a comparison project's
filename. A comparison file (filename.ASQ) contains all connection
information and settings the Diff needs to start comparing two
databases (you might need to supply the passwords, though), so when
you specify it in the command line, the Diff will run the
When the Diff gets
installed, it registers itself as the application to open .ASQ
files. Therefore to re-run a saved comparison, you can simply click
a comparison document in a File Explorer window.
The Diff also recognizes
several command-line switches. Since most of the switches control
loading and saving of the Diff's options, let's first look where
the Diff keeps its configuration.
options in file or registry; "portable" mode.
Starting from version
1.90, AdeptSQL Diff can keep its configuration in .INI files as
well as in the system registry. Please
note that the format of Diff
options in the registry has changed and is not backward-compatible
with Diff versions prior to 1.90. The program will NOT read the old
settings, so even if you have an earlier version, you'll have to
configure the new one again.
When the Diff starts
(without any command line switches modifying its behaviour), it
first tries to locate a file called ASQLDIFF.INI in the same
directory the executable is running from. If such file exists, the
settings it contains are loaded. After that, the Diff checks if
another set of options exists in the system registry. If it does,
whatever is in the registry overrides the settings from the
When the program is
closing, it writes its modified configuration back to the registry,
or if the registry key for AdeptSQL Diff doesn't exists, back to
the INI file. The Diff won't write its configuration to both places
at once and it won't write to the registry if no Diff keys existed
The reasoning behind such
behaviour is as follows. The configuration file ASQLDIFF.INI is
included in the setup and supposed to contain some "original" or
"default" option set. It is normally not overwritten when the
program exits. The registry entry for AdeptSQL Diff is created when
the program is installed and works as the regular option storage.
All changes you make are normally saved there.
However, it is
anticipated that the Diff can also be used in "portable" mode, when
it is not actually installed on a system, but is run directly from
a removable media, like AdeptSQL Toolkit flash drive. In this case
there will be originally no registry key for AdeptSQL Diff and none
will be created as a result of running the program, so the system
remains "clean". All options will be both loaded from and saved to
the default .INI file.
The command-line switches
can be placed either before or after the document name and must
start with '/' or '-'. The switches are case-insensitive, some of
them have several alternative spellings (e.g. '-i'
Some of them can be optionally followed by an INI file name, which
must not be confused with the comparison document parameter
described above (so you must NOT specify "-i", "-ri" or "-wi"
directly before the document name).
The following switches
Diff to read configuration from and save it to the default or
specified .INI file, even if the registry entry is present. This
works as a shortcut for the combination of -ri
Diff to read
from the default or specified .INI file. Does not affect saving the
changed options on exit.
Diff to write
to the default or specified .INI file. Does not affect loading the
options on startup.
Diff to create a registry entry for the product, if it didn't exist
before. Therefore on exit the Diff would write its configuration to
the registry, according to the rules described above. While the
switch doesn't exactly conflict with -ini
doesn't make much sense to use them together. On the other hand,
the combination of "-ri
would have an effect of copying all settings from the INI file to
switch can be used when you also specify a comparison file to tell
the Diff that all comparison configuration should be loaded, but
the comparison is not to be started automatically. This
allows you to change the connection parameters of the loaded
comparison before pressing [Compare]
settings vs. project-level settings.
There is currently no
overlap between "project options" (those specific to a particular
comparison and saved in a .ASQ file) and "environment options"
(saved to registry or .INI file as described above). The
project-level settings include the connection parameters plus any
schema-loading filters, renaming associations and DataDiff settings
for specific tables. All the rest - any settings that are available
through the Options dialog (e.g. scripting styles) are considered
"environment-level" and not saved with the project. It is possible
that future versions would allow to redefine some of these setting
on the project level as well, but no such functionality has been
implemented so far.
Meanwhile, if you really
need different option sets for different comparisons, use the
command-line switches described above to start the Diff with
different configuration files according to the comparison you are
going to work with:
-i c:\my_options.ini c:\my_comparison.asq