Toad World® Forums

Call Utilities->Compare files from the command line

It there a way I can call Utilities->Compare files from the command line. I would like to set up my Code management for format and then compare the history of 2 files.

Something like toad.exe /compare file1 file2

in Toad version 12.12 and newer, there's a Compare Files action in automation designer, which you can call from command line as you would any other action in automation designer.

It's on the "File management" tab.

edit: Toad version

how do i pass the file1 file2 filenames to the compare files dialog. All i see is "specific files" and "files in folder"? Can I add an argument somehow?

Some of the actions support parameter files, so you could add your arguments into a file and then run the action like:

Toad.exe -a "Action1 | c:\Action1.ini"

where App1 is the name of the action and the inifile is the parameter file (created by right-clicking the action in automation designer, then you can edit).

But I see that the compare files action doesn't support parameter files. I can add that for next beta.

The only workaround that I can think of for you now, is use the "folders" option and put your files to compare in the specified folders . In this case, the file names in each folder would have to match, so...


You can of course have multiple files in each folder

if you can add the parameter, that would be great. I can not changes the file names in the code repository software.

I'll add it. How about this for a workaround?

mkdir c:\Temp\Folder1
mkdir c:\Temp\Folder2
xcopy file1_from_repository c:\Temp\Folder1\File1.txt
xcopy file2_from_repository c:\Temp\Folder2\File1.txt
then call toad

Done for next beta. Here's a quick video on how to use it.

so i need to modify the command file prior to calling the automation to change the file1/2 names. This is doable, but it would have been easier on my side if the command like accepted, file1/file2 as arguments. Thanks, this could work.
Toad.exe -a "App1->compare" c:\files\a.sql c:\files\a.olderfile.sql

I understand, but parameter files is how we support arguments to actions.

There are a couple dozen different kinds of actions and a lot of them support parameters. If the parameters were all "loose" on the command line, the command line syntax would be too difficult to keep straight.

The files are a little more effort but you know exactly what's what.