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 >
Wrap
OS/2 REXX Batch file
|
1994-12-24
|
1KB
|
28 lines
@echo off
rem Makes OS2You release the com-port and starts zoc with the
rem given options. The srcipt does this by killing OS2You using
rem KILLEM. After terminating ZOC, OS2You is restartet.
rem The shell, from which this script is launched, is 'lost', if
rem it is not started with 'detach' or 'start'.
setlocal
set TMP=c:\tmp
set ZOCPATH=d:\apps\zoc
set OS2YOUPATH=d:\apps\os2you
del %TMP%\killos2you*.cmd 2>nul 1>nul
pstat | grep "OS2YOU\.EXE *01" | awk "{ print $2 }" > %TMP%\killos2you1.cmd
sed -e "s/\([0-9][0-9]*\)/set ppid=\1/" <%TMP%\killos2you1.cmd >%TMP%\killos2you4.cmd
call %TMP%\killos2you4.cmd
pstat | grep "OS2YOU\.EXE *01" | awk "{ print $1 }" > %TMP%\killos2you5.cmd
rem Now check, if PPID corresponds to a CMD shell. Only kill, is this is true.
pstat | grep "^ *%PPID% .*CMD\.EXE" | awk "{ print $1 }" >> %TMP%\killos2you5.cmd
sed -e "s/\([0-9][0-9]*\)/kill \1/" <%TMP%\killos2you5.cmd >%TMP%\killos2you2.cmd
echo @echo off >%TMP%\killos2you3.cmd
copy %TMP%\killos2you3.cmd + %TMP%\killos2you2.cmd %TMP%\killos2you.cmd 2>nul 1>nul
call %TMP%\killos2you
del %TMP%\killos2you*.cmd
%ZOCPATH%\zoc.exe /C /O:%ZOCPATH%\options\0-Modem
chcp 437
start %OS2YOUPATH%\os2you.exe -c %OS2YOUPATH%\os2you.cfg
endlocal