Previous Topic: Pass Positional Arguments in a Windows JobNext Topic: Specifying the Command or Script Name Without the Full Path in a Windows Job


Pass Environment Variables in a Windows Job

In Windows, you specify environment variables to define the local environment the command or batch file runs in. You can modify existing environment variables or create your own.

To pass an environment variable to a command, specify the ENVAR statement in the job definition. You can specify multiple ENVAR statements in a Windows job definition.

Example: Pass Windows Environment Variables to a Batch File

This example includes three ENVAR statements that pass environment variables to a Windows batch file and a fourth ENVAR statement that defines the home directory:

CMDNAME c:\payroll\command1
AGENT NT_NY
ENVAR A=B
ENVAR C='X Y'
ENVAR E=pay
ENVAR HOME=c:\export\u1

In this example, the command command1 can reference these variables:

Environment Variable

Value Passed

A

B

C

'X Y'

E

pay

HOME

c:\export\u1