Skip to content

TSTool / Command / SetWorkingDir


The SetWorkingDir command sets the working directory for following commands. The working directory is normally set in one of the following ways, with the current setting being defined by the most recent action that has occurred:

  1. The startup directory for the TSTool program,
  2. The directory containing the most recently opened or saved command file.
  3. The directory specified by a SetWorkingDir command,
  4. The directory specified by File / Set Working Directory menu in TSTool.

In most cases, a SetWorkingDir command is not needed and should be avoided because it may complicate commands and troubleshooting. However, for complicated command files that process data in multiple directories, it may be useful to change the working directory during processing. Setting the working directory to an absolute path causes all relative paths for input and output files to be appended to the working directory. Relative paths that use ../ can be specified to move up and down a directory tree. The current working directory during processing is reset to the initial working directory (the location of the command file) each time that the commands are run.

In any case, it is recommended that paths used in command parameters are specified using relative paths (relative to the command file) so that command files and associated data files can be easily moved from one computer to another.

Command Editor

The following dialog is used to edit the command and illustrates the command syntax.


SetWorkingDir Command Editor (see also the full-size image)

Command Syntax

The command syntax is as follows:


Command Parameters

Parameter     Description Default                
The working directory that should be used. Specify a relative path (e.g., ..) to adjust the current working directory. Can be specified using {Property}. None – must be specified.
RunMode Indicate the run mode in which the command should be applied, one of:
  • GUIOnly – the command applies only to interactive runs
  • GUIAndBatch – the command applies to interactive and batch runs
  • BatchOnly – the command applies to batch runs only


See the automated tests.


See Also

  • Message command - can be used to output the working directory