echo off

if %1 == Zmodem goto Zmodem
if %1 == Wxmodem goto Wxmodem
if %1 == Ymodem goto Ymodem
if %1 == Ymodem-Batch goto Ymodem-Batch
if %1 == Xmodem goto Xmodem
if %1 == Sealink goto Sealink
if %1 == Megalink goto Megalink
if %1 == Kermit goto Kermit
if %1 == K9Xmodem goto k9Xmodem
if %1 == Jmodem goto Jmodem
if %1 == Super8K goto Super8K
if %1 == Lynx goto Lynx
if %1 == Puma goto Puma
if %1 == MobyTurbo goto MobyTurbo
if %1 == Pkzip goto Pkzip
goto end
 
rem      to add other protocols just follow these examples
 
rem %1 = protocol name, make sure it is exact match as what is in the
rem      protocol.def file so the %1 == matches up (it is case sensitive also)
rem %2 = port number (1, 2, 3, 4)
rem %3 = baud rate (true baud, not locked baud)  if you are locking your
rem      port and the protocol needs to know the locked speed hardcode it
rem      into this batch file
rem %4 = filename being passed to transfer.  This will also contain the
rem      path to the file.  For batch it will be @drive:\path\batch.dsz

:Zmodem
dsz sz %4
goto end

:MobyTurbo
dsz sz -m %4
goto end

:Kermit
kermit send %4
goto end

:Megalink
mlink16 port %2 sm %4
goto end

:K9Xmodem
rem this is for unlocked ports
rem superk p%2 s%3 sk f %4
rem this is for locked ports, batch mode
superk p%2 s38400 u%3 c l skb f %4
goto end

:Jmodem
rem this is for unlocked ports
rem superk p%2 s%3 sj f %4
rem this is for locked ports
superk p%2 s38400 u%3 c l sj f %4
goto end

:Sealink
clink /p%2 t %4
goto end

:Super8K
rem this is for unlocked ports
rem superk p%2 s%3 ss f %4
rem this is for locked ports, batch mode
superk p%2 s38400 u%3 c l ssb f %4
goto end

:Wxmodem
rem superk p%2 s%3 sw f %4
superk p%2 s38400 c l u%3 sw f %4
goto end

:Xmodem
dsz sx %4
goto end

:Ymodem
dsz sx -k %4
goto end

:Ymodem-Batch
dsz sb -k %4
goto end

:Ymodem-G
dsz sb -g %4
goto end

:Lynx
lynx s %4
goto end

:Puma
puma s %4
goto end

:Pkzip
rem waka1 monitors carrier on com1, exits gracefully if user hangs up
rem waka1 pkzip.exe -rp %2 %3 >%4
pkzip -rp %2 %3 >%4
if %5 == 0 goto end
pkzip -z %2 <how2un.zip
goto end

:end
