Summary

You have a program or batch file that you have tested by running it directly from a Windows command prompt. When you run the same program or batch file from an adTempus job, the job fails.

Troubleshooting: Capture Console Output

When a job fails, adTempus will log a message in the Job Log indicating the reason. If the failure is due to a problem with your program or batch file, the failure message will generally indicate that the job returned a failure exit code:

Sample failure message

If the failure is not the result of a failure exit code, see article K00000184 for other troubleshooting suggestions.

In this case the first step in diagnosing the problem is reviewing the output from your program or batch file. This can come from two sources:

  • Log files, Event Log messages, etc., created by your program.
  • The console (screen output) from the program or batch file.

If you are not already using the Capture Console setting in your job, you should enable that option and rerun the job.

Now rerun the job. After it fails, locate the failed instance on the History tab in the Console and open it. On the Captured Files page of the instance properties you will find a captured file named "Captured console output.txt". Open this file to view the output from the program or batch file. This will show you where and why the batch file failed.

Common Problems

Following are some common problems that cause batch files to fail when run in adTempus even though they work outside it.

Permission and Environment Problems

When you test your batch file outside of adTempus, make sure you are logged in using the same user account that the adTempus job is configured to use. If Administrator permissions are required for anything run by the job, make sure you have checked the Run with highest privileges option in the Job Properties.

Mapped Drive Letters

If your batch file uses drive letters that are mapped to network resources, it will fail unless you have mapped those drive letters on the Resources page of the Job Properties. (see the Network Access for Jobs help topic for more information). The error message shown in the captured output will be:

The system cannot find the drive specified.

Though you can map the drive letter within adTempus, this is not recommended. Instead, you should replace all references to the drive letter with the corresponding UNC path. For example, suppose your batch file has this line:

c:\processing\myprogram /processfiles /source m:\inputfiles\*.*

The M: drive is mapped to the UNC path "\\prodserver3\data" (e.g., share "data" on server "prodserver3"). You would replace all references to drive M: with the UNC path:

c:\processing\myprogram /processfiles /source \\prodserver3\data\inputfiles\*.*

Relative Paths

Be sure that you fully qualify all paths and file names that you use. For example, suppose your batch file has this line:

myprogram /processfiles /source \\prodserver3\data\inputfiles\*.*

When you test this it works, because you have the current directory set to "c:\processing" for your command prompt. When adTempus runs the batch file it will fail with the error "myprogram' is not recognized as an internal or external command, operable program or batch file", unless you have set the Startup Directory for the step.

Rather than depending on the directory to be set, you should specify the full path so Windows can find "myprogram":

c:\processing\myprogram /processfiles /source \\prodserver3\data\inputfiles\*.*