************************** Set Host Working Directory ************************** Problem ======= You want to set the working directory of the host. Solution ======== To set the host's working directory, set :py:attr:`working_directory` on the job's task environment and pass the path of the desired working directory. The string will be resolved by expanding the string as an environment variable. For instance, "%TEMP%" will resolve to the full temporary directory path. The task will fail if the directory does not exist on the agent machine. .. literalinclude:: ..\..\..\code\HowTos\SetHostWorkingDirectory.py :language: python :linenos: Discussion ========== By default the working directory of the host process is the agent bin folder. There are some cases where a task needs a user defined working directory. The most common of these cases is that the application assumes a relative path to data. Sometimes this can be avoided by modifying the application itself. However, setting the working directory is an option in cases where modifying the application is not possible.