Using the Scheduled Command Line task can be a bit tricky, mainly due to the obtuse way Windows deals with the command line processor and batch files.
Generally, full paths should be given to batch files, executable files, and targets. If your path includes any spaces, you have to use
double quotes around the path name.
For example, to run a batch file stored in the AirVision Server directory, the task setup might look like this:
Executable:
cmd.exe
Command Line Arguments:
/c "c:\Program Files\Agilaire LLC\AirVision Server\blah.bat"
You can't just put
blah.bat by itself in the executable path. Windows doesn't like it.
Also, when using batch files
be very careful to create the batch file in NOTEPAD, and do not copy/paste where quotes are involved. There is a subtle difference between the quotation marks used in MS Word and those used by cmd.exe and in batch files. Curly (Word) quotation marks will
not work!
To run an executable directly using the Scheduled Command Line Task, the setup might look more like this:
Executable:
“C:\Program Files\Agilaire LLC\AirVision Server\EdasImporter.exe”
Command Line Arguments:
/P x:\IncomingLogbooks /D LogBook
Also, be aware that permissions can be an issue. The Server will run the process based on the AirVision Service logon rights (typically the Local System Account). This account may not always have access to shared drives or certain directories on the server.
Adding Debug To Your Batch File
Still having difficulties with your batch file executing? Try adding some debug / capture statements within the batch file (since AirVision can't trap these errors);
you can capture output of the programs by redirecting to a file, like this:
date > C:\myLogFile.txt
echo Starting >> C:\myLogFile.txt
myCommand.exe >> C:\myLogFile.txt
date >> C:\myLogFile.txt
echo Finished >> C:\myLogFile.txt