Symptoms
In the Target of a Program Execution Task, you specify a program name without its full path. For example:
perl.exe
instead of
c:\perl\bin\perl.exe
When you run "perl.exe" from the command line it works correctly, because the directory "c:\perl\bin" has been added to the system's PATH environment variable.
Cause
There are two common causes for this problem:
- The directory was set in a user's PATH variable, rather than the System's PATH variable. When adTempus tries to run a program, the System's path is used to resolve the location. So even if the directory is in the path of the user whose account you are using for the job, adTempus will not find the file.
- This problem can occur if the adTempus service has not been restarted since you added the directory to the PATH environment variable. The PATH that is "seen" by the adTempus service is fixed when the adTempus service is started. Any additions or changes to the PATH after that will not have any effect on adTempus. Note: In some cases it may be necessary to restart the computer, not just the service, before adTempus can see path changes.
Resolution
If possible, you should always specify the full path to the executable in the Target for the step, rather than relying on the PATH environment variable.
In cases where this is not possible (e.g., to simplify migration of jobs from one server to another, where the location may differ), be sure the required directory is in the PATH environment variable for the System, not for a specific user. Also you will need to restart the adTempus service (and possibly the computer) when you make changes to the PATH.
More Information
The limitations discussed above only apply when adTempus is trying to resolve the location of the program it is running. In all cases, adTempus will pass the correct environment variable settings to the program it does run. The computer does not need to be restarted after changing environment variables except in the specific case where the variable is needed by adTempus to resolve the program location.
For example, if you change the value of the "MyVariable" environment variable, any program run by adTempus will receive the new value for that variable even if the computer is not restarted.