Home > FAQ > Useful Basic Tasks when writing a script > How do I find the window which has the focus?

Compilation in Batch Mode

Compiling is usually done through the Start/Run menu or by clicking  icon; 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 (x86)\wintask\bin\taskcomp.exe" /<switch> "C:\program files (x86)\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 (x86)\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 (x86)\wintask\bin\taskcomp.exe" /b "c:\program files (x86)\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 (x86)\wintask\bin\taskcomp.exe" /b "%%f"
pause 
rem Delete the LST files
del *.lst