Users who have been running batch jobs with AQT v10 or prior versions should read this topic
There have been a number of changes to the running of batch jobs; these are outlined here.
AQT maintains backward compatibility - your existing batch jobs will continue to run without any changes. However, it is recommended that you make a number of changes, as outlined below.
It is recommended that your batch jobs be placed in a single directory, and this directory is specified in Options > File Locations > Location of Batch Jobs. Having all the batch jobs in a single directory enables them to be managed using the Manage Batch Jobs system.
AQT provides a number of sample batch files in C:\Users\<username>\AppData\Roaming\Advanced Query Tool\batch and Location of Batch Jobs will default to this location. If you are running batch jobs frequently, you may wish to use another directory.
Note that the default directory can only be used by yourself, and will not be found if you have scheduled a batch job to run under a different userid,.
When running your script, it is recommended that the *.bat file contains the following command at the top:
set aqtcmd=%cmdcmdline%
This sets the name of the *.bat file to the aqtcmd environment variable; this is then picked up by AQT. This allows AQT to include the name of the *.bat file in the Job History.
The Manage Batch Jobs window will warn you if this set command is not present in a script, and will allow you to add it easily.
This is an optional but useful step. You can add a description to your batch by including the following line near the top of your *.bat file
rem desc=Job description
The description will appear in the Manage Batch Jobs window plus Job History.
This an optional step. As with AQT v11, the command which runs AQT in the batch script has changed to a new format. This is (for example):
aqtv11.exe sqlfile=RunReport.sql,logfile=RunReport.log,append=y,desc="Overdue Invoices for $month"
This new command format is detailed in Technical Notes on Batch Jobs.