@echo off
if exist c:\portwiz.exe goto NEXT
copy portwiz.exe c:\  
:NEXT
if "%1"=="1" goto COM_1
if "%1"=="2" goto COM_2
if "%1"=="3" goto COM_3
if "%1"=="4" goto COM_4
goto INST
:COM_1
cls
echo.
echo.
echo Trying COM1...
call c:\portwiz 3f8 12 11 15 10 7 5 /w
goto END
:COM_2
cls
echo.
echo.
echo Trying COM2...
call c:\portwiz 2f8 12 11 15 10 7 5 /w
goto END
:COM_3
cls
echo.
echo.
echo Trying COM3...
call c:\portwiz 3e8 12 11 15 10 7 5 /w
goto END
:COM_4
cls
echo.
echo.
echo Trying COM4...
call c:\portwiz 2e8 12 11 15 10 7 5 /w
goto END
:INST
cls
echo.
echo.
echo.
echo SETPORT/PORTWIZ Usage Instructions
echo.
echo Setport will assign your Plug and Play modem
echo to the COM Port of your choice and to a free
echo IRQ (Interrupt ReQuest line) by running Portwiz
echo with the COM Port (1-4) of your choice as an
echo argument.
echo.
echo Upon successfully querying the modem, Portwiz
echo will also give you the option of automatically
echo adding a line to your autoexec.bat that will
echo properly configure the modem each time you turn
echo on your computer. It will then ask you if you
echo would like it to add/modify the COMnIRQ= and 
echo COMnBASE= lines in system.ini. It is strongly 
echo suggested that you let it proceed.
echo.
pause
cls
echo.
echo.
echo.
echo To use Setport/Portwiz do the following:
echo.
echo 1. Exit Windows 3.x completely.
echo 2. From a DOS prompt, type SETPORT (COM port number).
echo.
echo Example: setport 3 (ENTER) will attempt to set the
echo modem up on COM3 and the first free IRQ that Portwiz
echo finds. NOTE: Once this is successful, be sure and make
echo a note of both the COM Port number and the IRQ number
echo for future reference. 
echo.
echo Please refer to the Quick Start guide for more detailed 
echo instructions.
:END
cd\
echo.
pause
cls

