How to set the Working Directory when running a Windows command job through an Autosys Agent
search cancel

How to set the Working Directory when running a Windows command job through an Autosys Agent

book

Article ID: 420954

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

We have a requirement to set the Working directory when running a Windows command job.
There is no Working directory job attribute.

How can we set the Working directory on a per-job basis

Environment

Autosys 12.x, 24.X

 

Resolution

There is an environmental variable PWD (Present Working Directory) that can be included in the job definition in the envar job attribute to set the working directory

insert_job: windows_test   job_type: CMD
command: Utility.bat
machine: <machine_name>
owner: <Job_Owner>
permission: me,mx,ge,gx
date_conditions: 0
std_out_file: "C:\Temp\%AUTO_JOB_NAME%.out"
std_err_file: "C:\Temp\%AUTO_JOB_NAME%.err"
alarm_if_fail: 0
alarm_if_terminated: 0
envvars: PWD=E\:\Projects\Batch_files

 

Additional Information

Pass Environment Variables in a Command Job