Command attributes for specifying directories

Command Line and Windows Command adapter requests contain <command> elements that can use the following optional attributes to specify directories for command execution or script location.

The following table describes the command attributes for directories.

<command> attributes for directories

Attribute

Description

<working-dir>

Specifies the directory where the command is executed

If this attribute is not specified, the command executes in the java ProcessBuilder object's default directory. This attribute is not valid for the Windows Command adapter.

Note

To execute a script from a specific directory, a period followed by a forward slash (./) must precede the script name.

<command-dir>

Specifies the directory in which the script is located

If this attribute is not specified, the script must be located in the current directory.

In the Command Line adapter sample XML request shown in the following figure, the command executes in the /usr/executionDir directory, using a script from the /usr/scriptDir directory.

XML sample of <command> attributes for directories

...
<commands>
  <command working-dir="/usr/executionDir" command-dir="/usr/scriptDir">MyScript.sh
  </command>
</commands>
... 
Was this page helpful? Yes No Submitting... Thank you

Comments