home *** CD-ROM | disk | FTP | other *** search
/ IBM Presents OS/2 Software Hits 1995 / OS-2_SW_HITS_2ND_EDITION_1995.ISO / i02 / zoc2you.cmd < prev    next >
OS/2 REXX Batch file  |  1994-12-24  |  1KB  |  28 lines

  1. @echo off
  2. rem Makes OS2You release the com-port and starts zoc with the
  3. rem given options. The srcipt does this by killing OS2You using
  4. rem KILLEM. After terminating ZOC, OS2You is restartet.
  5. rem The shell, from which this script is launched, is 'lost', if
  6. rem it is not started with 'detach' or 'start'.
  7. setlocal
  8. set TMP=c:\tmp
  9. set ZOCPATH=d:\apps\zoc
  10. set OS2YOUPATH=d:\apps\os2you
  11. del %TMP%\killos2you*.cmd 2>nul 1>nul
  12. pstat | grep "OS2YOU\.EXE *01" | awk "{ print $2 }" > %TMP%\killos2you1.cmd
  13. sed -e "s/\([0-9][0-9]*\)/set ppid=\1/" <%TMP%\killos2you1.cmd >%TMP%\killos2you4.cmd
  14. call %TMP%\killos2you4.cmd
  15. pstat | grep "OS2YOU\.EXE *01" | awk "{ print $1 }" > %TMP%\killos2you5.cmd
  16. rem Now check, if PPID corresponds to a CMD shell. Only kill, is this is true.
  17. pstat | grep "^ *%PPID% .*CMD\.EXE" | awk "{ print $1 }" >> %TMP%\killos2you5.cmd
  18. sed -e "s/\([0-9][0-9]*\)/kill \1/" <%TMP%\killos2you5.cmd >%TMP%\killos2you2.cmd
  19. echo @echo off >%TMP%\killos2you3.cmd
  20. copy %TMP%\killos2you3.cmd + %TMP%\killos2you2.cmd %TMP%\killos2you.cmd 2>nul 1>nul
  21. call %TMP%\killos2you
  22. del %TMP%\killos2you*.cmd
  23. %ZOCPATH%\zoc.exe /C /O:%ZOCPATH%\options\0-Modem
  24. chcp 437
  25. start %OS2YOUPATH%\os2you.exe -c %OS2YOUPATH%\os2you.cfg
  26. endlocal
  27.  
  28.