Worked Examples for Batch
- Last UpdatedNov 17, 2025
- 3 minute read
Worked Example 1
To run a batch that opens a session of Model (installed with Unified Engineering) in TTY mode, with APS project, using credentials SYSTEM/XXXXXX, and opening MDB /ALL. Then run a macro stored at: C:\temp\Model_export.pmlmac.

To suppress the connect login if CONNECT/LaaS is in use, add --interactive:false. In addition, to add logging (which is an equivalent of alpha log in the command line of the product), added --logfile:c:\temp\Model_export.log
As a result, the completed command string could look like this.
ue --module:Model --project:APS --username:SYSTEM --password:XXXXXX --mdb:/ALL -tty --macro:c:\temp\Model_export.pmlmac --interactive:false --logfile:c:\temp\Model_export.log
Worked Example 2
To run a batch which opens a project held in a different project environment from the one that was set up in the first run. In this run, the evar %project_dir% is redefined temporarily for the batch, this new path is defined with the argument -pd or –projectsdir. The batch expects to find a custom_evars.bat at this path that will define the projects to use in this batch.

In this example, Admin is opened for project APS as defined by custom_evars.bat stored in C:\projects\ (with evar %projects_dir% set to C:\projects\) even though in first run this was set to a path on the D: drive. Using credentials SYSTEM/XXXXXX in tty mode and with the CONNECT login dialogue supressed with -i:false
Worked Example 3
To run a batch which open the APS project in a session of Paragon for user SYSTEM with password XXXXXX. Use MDB /PIPECAT and then run the macro stored at c:\temp\spec report.pmlmac (note that there are spaces in this name and therefore this argument is in quote marks.)

Worked Example 4
Using encrypted credentials, log into APS project in AVEVA Administration.
Start by producing an encrypt script in AVEVA Administration. For information about creating an encrypted script, refer to On premise entry batch - encrypted credentials in AVEVA Administration.
The resulting encrypted file is displayed:

The PML macro that is targeted by the command line call now has an additional first line to run this encrypted file to give the encrypted log in parameters.

Because the encrypted file contains the credentials, project and MDB, these things are not needed in the command line call. Therefore, in this case, this is the command line call for the batch.

In this case, as no module has been defined, Monitor is opened, any other module can be opened when the macro is run. The first thing the batch macro does is open the encrypted file and read all the set log in parameters.