Compilation in Batch Mode
Compiling is usually done through the Start/Run menu; a Compilation dialog is displayed and the .SRC file is compiled into a .ROB file.
Compiling in batch mode allows you to compile several .SRC files without displaying the dialog box.
Use the following command line:
"C:\program files\wintask\bin\taskcomp.exe" /<switch> "C:\program files\wintask\scripts\<myscript>.src"
<switch> can be:
b
If no errors are detected during compilation, the compiled <myscript>.rob is created; if an error is detected, the usual compilation dialog box is displayed.x
If no errors are detected during compilation, the compiled <myscript>.rob is created and the script is launched; if an error is detected, the usual compilation dialog box is displayed.v
If no errors are detected during compilation, the compiled <myscript>.rob is created; if an error is detected, the usual compilation dialog box is displayed and the list of errors is displayed (.LST file).Return codes from TASKCOMP.EXE
0
no error, no warning
1
at least one error
2
no error, but at least one warning
Batch examples
.BAT for compiling a couple of .src files in the same batch file:
set COMPILER=c:\program files\wintask\bin\taskcomp.exe
"%COMPILER%" /b "script_One.src"
"%COMPILER%" /b "script_Two.src"
"%COMPILER%" /b "script_Three.src"
Another example with no echo:
@echo off
"c:\program files\wintask\bin\taskcomp.exe" /b "c:\program files\wintask\scripts\test.src"
if errorlevel 2 goto warning
if errorlevel 1 goto error
if errorlevel 0 goto ok
:warning
echo Warning(s) !
goto end
:error
echo ERROR(S) !
pause
goto end
:ok
echo OK
goto end
:end
.BAT for compiling all the .src files in the Scripts directory :
Note : the FOR statement converts names longer than 8 characters to short names using the ~ character.
for %%f in (*.src) do "c:\program files\wintask\bin\taskcomp.exe" /b "%%f"
pause
rem Delete the LST files
del *.lst
rem run the compiled scripts
for %%f in (*.rob) do "C:\Program Files\WinTask\Bin\TASKEXEC.EXE" "%%f"