home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / modem / modem.bat next >
DOS Batch File  |  1995-04-16  |  973b  |  39 lines

  1. @echo off
  2.     cls
  3.     if "%1" == "1" goto setmode
  4.     if not "%1" == "2" goto usage
  5. :setmode
  6.     set port=%1
  7.     shift
  8.     mode com%port%:2400,n,8,1,p
  9.     if not exist %1.exe goto calling
  10.     echo Preparing to answer...
  11.     echo ATS0=1 > com%port%
  12.     goto play
  13.  
  14. :calling
  15.     echo Dialing %1 ...
  16.     echo ATDT%1 > com%port%
  17.     shift
  18. :play
  19.     echo Running %1 -net -com %port% %2 %3 %4 %5
  20.     echo Wait for connection, then
  21.     pause
  22.     %1 -net -com %port% %2 %3 %4 %5
  23.     type pluses > com%port%
  24.     echo Hanging up now ...
  25.     pause
  26.     echo ATH0S0=0 > com%port%
  27.     echo ATZ > com%port%
  28.     goto end
  29. :usage
  30.     echo Usage:
  31.     echo    modem [comport] [phone #] [game] [parameters]
  32.     echo Where:
  33.     echo    [comport]    = 1 or 2
  34.     echo    [phone #]    = number to dial (omit for answer mode)
  35.     echo    [game]       = name of game executable
  36.     echo    [parameters] = command line options for game program
  37. :end
  38.     set port=
  39.