REM silent install script
@echo off
setlocal DisableDelayedExpansion
set "printer=%~1"
set port=%~2
set "infname=%~3"
SET /A ARGS_COUNT=0
setlocal EnableDelayedExpansion
FOR %%A in (%*) DO SET /A ARGS_COUNT+=1

rem ECHO %ARGS_COUNT%
rem if "%1"=="" GOTO ERROR
if "%2"=="" GOTO ERROR
rem if "%3"=="" GOTO ERROR


FOR /F "tokens=*" %%i in ('"%~d1%~sp1is64.exe"') do SET is64=%%i    
REM echo NNN%is64%NNN
if "%is64%"=="64    " goto SIXFO
cd ZBRN/Win32
goto SKIP
:SIXFO
cd ZBRN/Win64
:SKIP   

RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b "%printer%" /f ZBRN.inf /r "%port%" /m "%infname%"
goto EOF


:ERROR
echo requires 3 parameters
echo   printer name     
echo   port name
echo   inf driver name
:EOF
cd ..
cd ..
