Using the command line to run Micromine Geobank jobs
The following types of Micromine Geobank jobs/tasks have auto-start and auto-close functionality so can be scheduled to run in Unattended Mode using Micromine Geobank’s Job Scheduler. These can be autonomously executed at a pre-set time, or on a regular schedule, such as every night:
-
Graphic Reports
For a graphic report to be run in unattended mode, a destination folder for the PDF report must be set. This setting is applied in the Configuration Manager in the Graphic Report properties in the Unattended Options tab.
It is recommended that Microsoft Print to PDF is used as the default printer for Graphic Reports to run in Unattended mode. This is the only Printer formally supported for unattended printing of Graphic Reports. Another printer can be chosen, but other printer options cannot be guaranteed to behave as expected. Note: Print to PDF is not supported on Application servers using a Windows Server Operating System below the minimum supported; which is Windows Server 2016.
-
Advanced Reports
-
Configured Imports
-
Configured Exports
-
Coordinate Transformations
-
Excel Imports
-
Action Queries
-
Query Groups
-
Receipts
-
Macros (containing any of the objects listed here, except for Forms, see below)
If a macro contains any unsupported object an error message will be logged in the log file (C:\ProgramData\MICROMINE\Geobank\Logs):
Macro could not be executed because it contains the following objects which cannot be run in unattended mode: <list of unsupported object names and types>
-
Forms
When a Micromine Geobank form is executed as a scheduled job in Unattended mode, the following occurs:
-
The form opens and executes any scripting which is either:
-
Written within the base script section of the form, or,
-
Written within the function called by the 'Loaded' event of the root grid object for the form.
-
-
Once the script has run, both the form and Micromine Geobank close.
This functionality can be used to automate any action which can be performed using the scripting functionality of Micromine Geobank forms. Types of actions could include: File system tasks; specialised imports or exports; data updated via datasets; email notifications, and other actions.
In addition, any type of Micromine Geobank task can be executed from the command line. Use the following steps to run a Micromine Geobank task from the command line:
- To add any object as a task, see: Property Editor: Macro
- In the Configuration Manager, right-click on Task (within a Profile and Task-list) and select Properties. This opens the Property Editor of the Task you want to run, in this case a Data View. The Command Line Key is the parameter you need, as shown below:
Tip: If the Command Line Key is “0” (not available to the command line), then copy and paste the task. The new task will have the next available integer as its Command Line Key - use the value as the parameter. The original task can then be deleted and the new one renamed.
- Right-click on your Windows desktop and select the New | Shortcut menu option.
- Browse to the Micromine Geobank executable and add the Command Line Key after the name of the executable: The full path command for the executable is:
"C:\Program Files (x86)\Geobank 2021.5\Geobank.Desktop.Launcher.exe" 273
- Click Next and supply a name for the desktop shortcut.
- Click Finish to create the shortcut.
-
6.7. Additional command line arguments are available see Command line arguments.
You can now double-click the shortcut to run the Macro/task object (i.e. the Edit Survey Data data view).
When in Unattended mode, macros automatically start, log errors instead of displaying errors, and automatically close when complete. In Unattended mode, when tasks have been completed (or errors logged), Micromine Geobank will automatically close.