    @ECHO OFF
    ECHO OFF
    CLS
    IF NOT (%1) == () GOTO OKPARM
    ECHO Purpose:  Simple terminal program for modem diagnosis
    ECHO Format:   TERM port [baudrate]
    ECHO Example:  TERM 1 1200
    ECHO Note:     Ports COM1 to COM4 are supported by this version of TERM.
    ECHO ÿ
    GOTO QUIT
:OKPARM

    IF (%2) == () GOTO NOSET
    MODEM %1 DROPDTR
    MODEM %1 SETBAUD %2
    IF ERRORLEVEL 1 GOTO QUIT
    ECHO ÿ
    ECHO Serial port baud rate set.
    ECHO ÿ
    ECHO If you have an external modem, and it is set at a baud-rate
    ECHO other than %2, turn it off, then turn it on again.
    ECHO ÿ
    PAUSE
:NOSET

    MODEM %1 TERM

:QUIT
