Summary

When a batch file run by the Arcana Scheduler does not produce the expected results, you should examine the output from the batch file for any errors or other important messages.

More Information

There are two ways you can view the output from your batch file.

Keeping the Console Window Open with Pause

The easiest way to view the output from the batch file is to add a "pause" statement on the last line of the batch file. This will cause the console window to stay open after the batch file completes, allowing you to review the output.

Output Redirection

If the batch file is running in non-interactive mode, or at a time when you cannot be present to view the output, you can redirect the output from the batch file to a text file.

If your batch file contains a single command, this can be done easily by modifying the batch file. For example, if the batch file contained the command

copy d:\*.* e:\

you would modify the batch file to

copy d:\*.* e:\ > c:\mybatchfile.log

If the batch file contains more than one command,  you can modify the batch file so that each command is redirected to a file:

copy d:\*.* e:\ >> c:\mybatchfile.log
c:\bin\somecommand.exe >> c:\mybatchfile.log

(Note the use of ">>" instead of ">").

Alternatively, you can redirect the output of the entire batch file by wrapping it within another batch file. For example, if the Scheduler is running "c:\bat\mybatchfile.bat", you would create a new batch file called "mybatchfileredirect.bat", containing the following command:

c:\bat\mybatchfile > c:\mybatchfile.log

and then have the Scheduler run "mybatchfileredirect.bat" instead of "mybatchfile.bat".

Using any of these redirection methods, the "mybatchfile.log" will contain the output from the commands run by the batch file.