@echo off
if "%1" == "" goto Error_Break
if "%2" == "" goto Error_Break
@echo setting the POSTouch driver that connect on system COM%2 (F81216 serial port #%1)
F81216IF
if errorlevel 1 goto DONE
@echo Find F81216D device.
call 1216set.bat
del  1216set.bat
echo.

if not "%1" == "3" goto F81216C4
:F81216C3
echo idTouch /%2 /I%F81216C3IRQHEX% /A%F81216C3IO%
     idTouch /%2 /I%F81216C3IRQHEX% /A%F81216C3IO%
goto F81216Check

if not "%1" == "4" goto F81216C1
:F81216C4
echo idTouch /%2 /I%F81216C4IRQHEX% /A%F81216C4IO%
     idTouch /%2 /I%F81216C4IRQHEX% /A%F81216C4IO%
goto F81216Check

if not "%1" == "1" goto F81216C2
:F81216C1
echo idTouch /%2 /I%F81216C1IRQHEX% /A%F81216C1IO%
     idTouch /%2 /I%F81216C1IRQHEX% /A%F81216C1IO%
goto F81216Check

if not "%1" == "2" goto Error_Break
:F81216C2
echo idTouch /%2 /I%F81216C2IRQHEX% /A%F81216C2IO%
     idTouch /%2 /I%F81216C2IRQHEX% /A%F81216C2IO%

:F81216Check
if errorlevel 1 echo ###  Error! No find the POSTouch controller in F81216 #%1 serial port  ###
if errorlevel 1 idTouch /u

:Error_Break
set errorlevel=1

:DONE
@echo on
