
Batch and Script is a powerful feature which allows you to easily dispatch the execution of local batches and scripts onto a single machine or a group of machines and receive a consolidated report of console outputs. The Batch and Script feature is accessible from any computer by expanding it and using the
Batch and Script node, or, via the context sensitive menu.
This feature can be used to run batches (.bat), scripts (.vbs, .pl, etc...) and even binaries.
Before you can execute a batch or script on a remote machine, you must define it. To do so, right-click on the
Batch and Script node of any computer and select Manage... to open the Run Batch Manager.

To add a new batch object, click on the
button and use the Properties area on the right to configure the new object.
To modify an existing batch object, select it and use the Properties area on the right to make your modifications.
To share (or unshare) a batch object with other people belonging to the Goverlan Workgroup, select it and click on the
button
To delete a batch object, select it from the batch list and click on the
button.
Enter the batch object's name and description.
Run Path - Specify the full path of the batch or script for this object. The batch can be located on your machine or in a network share.
Transfer Methods - Select The run path is accessible from the remote machines if the path specified points to a network share, or, Transfer the program to the following directory then run from local path to have Goverlan first transfer the batch program onto a temporary location on the target machines and then run it from there.
If you select to transfer the batch first, you can modify the destination folder on the target machines. Note: The destination path may contain environment variables but they will be resolved using the System Variable set (not the User Variable Set).
If the batch program has external dependencies, enable the Transfer the entire parent directory option. The dependencies must be located at the root of the parent folder.
EnableDelete file(s) after execution if you wish to clean up the transferred files once the batch is completed.
Execution - Select the credentials to use to execute the batch program. Note: If the batch is run directly from a network share, you cannot select Run As Local System since this account doesn't have network access.
Enable Hide execution window to prevent the user interface from being displayed on the target machine during execution.
Output - Configure the execution time out value and decide if you want Goverlan to kill the batch process if a time out occurs.
If the batch program has reporting or error console output, enable the Record console output to option and configure an output text file path. The console output of the batch for all machines will be compiled into that output file. Goverlan automatically opens it at the end of the execution.
Click on Apply.
This feature supports batch programs, scripts and binaries. However, depending on the type of the object, the run path must be configured properly.
A batch program (.bat) contains a series of command prompt instructions. It can process commands and calls outside batch programs or scripts.
Let's use an example. We have a dedicated directory called Batches which contains batches and scripts.

This directory contains visual basic scripts which outputs some information about the local machine and a Perl script which uploads local data files onto a server.
We need to execute both on target machines. We create a batch program called RunAll.bat with the following contents:

In effect, this batch program simply calls the other scripts using the appropriate interpreter.
Finally, we configure the Goverlan Batch program to run \\madoco\GoverlanShared\Batches\RunAll.bat and configure the Transfer options to either:
The run path is accessible from the remote machines
Note: If you select this mode, the path to other scripts within the primary batch should be the full UNC path. For instance, to run the scriptCheckNetConfig.vbs from within the RunAll.bat, you need to enter:
CScript \\madoco\GoverlanShared\Batches\scriptCheckNetConfig.vbs
or
Transfer the program ... and Transfer the entire parent directory
Running a script involves specifying a script interpreter in the run path. Since the script interpreter is already on the target machine, Goverlan only transfers the file that is pointed to by the script interpreter. When specifying a Run Path for a script, enter both the script interpreter and the script path in between single quotes.
For instance, the Run Path for the script C:\Data\Scripts\vbs\helloWorld.vbs is:
CScript.exe 'C:\Data\Scripts\vbs\helloWorld.vbs'
Do not forget to specify the extension (.exe) of the script interpreter.
Then, select the appropriate transfer method. In this case, since the script is located locally, you would select Transfer the program ...
You can also use this feature to remotely dispatch the execution of binary files. When doing so, remember that the binaries to be dispatched must only process tasks and terminate without a user interface prompt.
For example, you have a program C:\HotFixes\hfxQ42234A_Install.exe which installs a security update on the local machine and you wish to dispatch its execution to some of your machines.
Configure the run path to be: C:\HotFixes\hfxQ42234A_Install.exe
Configure the Transfer to be: Transfer the program to the following directory then run from local path
Un-check the Record console output to option (unless the binary outputs console data).
Once you have configured your batch objects, you can easily dispatch their execution on a single machine or a selection of multiple machines.
To run the batch object on a single machine, expand the Batch and Scripts node under the desired machine and double click on the batch object to execute.
To run the batch object on multiple machines, use the [CTRL] or [SHIFT] key to select two or more machines in the main view or in the Search result list, right-click on the mouse, expand the Batch and Scripts sub-menu and select the batch object to execute.
To run a batch or script on a large number of machines, use the Execute Computer Action > Processes > Run a batch or script option in a Scope Action.
