Creating a Script - Intergraph Batch Services - Installation & Upgrade

Intergraph Batch Services Quick Start

Language
English
Product
Intergraph Batch Services
Search by Category
Installation & Upgrade
Smart 3D Version
13.2

A batch job reads a script and performs the instructions in it, using the appropriate shell (the program that runs the instructions in the script). Scripts can take many forms, including .bat files and Perl scripts. A script can also be an executable program (.EXE file) if the queue has no default shell, or if the shell is set to CMD.EXE.

The following example is a .bat script that backs up a directory on the batch server to a shared drive that has been locally mounted from a remote system. To use the script, ensure that a local batch queue has been created, enabled, and started, and that the queue’s default shell is the cmd.exe program.

REM This script will do the following:

REM

REM 1. Mount the shared drive \\machine\share

REM 2. Copy everything in c:\users\default to the shared drive.

REM 3. Unmount the shared drive.

REM

net use p: \\machine\share

xcopy c:\users\default p: /e /i

net use /delete p:

The following example is a .bat script that prints all PostScript files in the c:\temp directory on the batch server to a printer on a remote Windows system. To use the script, ensure that a local batch queue has been created, enabled, and started; that the queue’s default shell is the cmd.exe program; and that your system has access to the printer on the remote Windows system.

REM This script will do the following:

REM

REM 1. Associate a remote printer on a Windows system

REM (\\machine\printer) with a local printer port.

REM 2. Copy files in c:\temp that end in .ps to the local printer

REM port.

REM 3. Remove the printer association.

REM

net use lpt1: \\machine\printer

cd c:\temp

for %%I in (*.ps) do copy %%I lpt1:

net use /delete lpt1: