@echo off
echo setting the ELO Touch driver that connect on Nm9835 serial port
if "%1" == "1" goto begin
if "%1" == "2" goto begin

:Show_help
echo.
echo. Command example: NM9835.BAT x
echo.     x=1-2 (Setting the driver that use NetMos Nm9835 PCI serial port No.x.)
goto Error_Break

:begin
9835info
if errorlevel 1 goto DONE
@echo Find Nm9835 device.
call 9835set.bat
del  9835set.bat
elodev 2210,0
nomouse
echo.

if not "%1" == "1" goto NM9835C2
:NM9835C1
echo ucomtsr %NM9835COM1IO% %NM9835IRQ%
     ucomtsr %NM9835COM1IO% %NM9835IRQ%
goto NM9835Check

:NM9835C2
echo ucomtsr %NM9835COM2IO% %NM9835IRQ%
     ucomtsr %NM9835COM2IO% %NM9835IRQ%

:NM9835Check
if errorlevel 1 goto NM9835NotFound
if exist ELOGRAPH.CAL goto NoEloCalib
echo.
echo    Please save ELOCALIB but don't update AUTOEXEC.BAT after next step
echo.
pause
elocalib

:NoEloCalib
monmouse
movement

goto DONE

:NM9835NotFound
echo ###  Error! No find the ELO Touch controller in Nm9835 No.%1 serial port  ###
goto DONE

:Error_Break
set errorlevel=1
goto DONE

:DONE
@echo on