@echo off
if "%SYSTEMROOT%" == "" goto error
if "%1" == "" goto usage
if "%1" == "a" goto all
rem     ===============================================================
echo.
echo Copying driver to NT system directory:
echo.
copy cbmdev%1.sys %SYSTEMROOT%\system32\drivers\cbmdev%1.sys
copy cbmvdd.dll   %SYSTEMROOT%\system32\.
echo.
echo Registering driver to NT system:
echo.
regini cbmdev%1.ini
echo.
goto end
rem     ===============================================================
:all
echo Copying all drivers to NT system directory:
echo.
copy cbmdev1.sys %SYSTEMROOT%\system32\drivers\cbmdev1.sys
copy cbmdev2.sys %SYSTEMROOT%\system32\drivers\cbmdev2.sys
copy cbmdev3.sys %SYSTEMROOT%\system32\drivers\cbmdev3.sys
copy cbmvdd.dll  %SYSTEMROOT%\system32\.
echo.
echo Registering all drivers to NT system:
echo.
regini cbmdev1.ini
echo.
regini cbmdev2.ini
echo.
regini cbmdev3.ini
echo.
goto end
rem     ===============================================================
:error
echo.
echo ERROR: expected %SYSTEMROOT% environment variable to be set.
echo.
goto end
rem     ===============================================================
:usage
echo.
echo Usage: cbminst port#
echo where port# can be:    1 - for port number 1  (monochrome card port)
echo                        2 - for port number 2  (usually LPT port 1)
echo                        3 - for port number 3  (usually LPT port 2)
echo                        a - for all ports (recommended)
echo.
echo Example to install on a standard system:
echo.
echo    CBMINST a
echo.
rem     ===============================================================
:end
echo.
echo Done.
echo.

