home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
pidsrv.zip
/
pidclnt.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-06-14
|
2KB
|
101 lines
/*PID Client v1.00 of PID Server*/
/*This program is used to kill a process on a remote machine that may be*/
/*blocking the que.*/
RxExtraAPI = RxFuncQuery('RxExtra') /* Checks for Rxextras */
IF RxExtraAPI \= 0 THEN
DO
Call RxFuncAdd 'RxExtra', 'RxExtras' , 'RxExtra'
Call RxExtra 'Load'
END
If RxFuncQuery('SysLoadFuncs') THEN
DO
IF RxFuncAdd('SysLoadFuncs','RexxUtil','SysLoadFuncs') THEN
DO
Say 'Error:Could not load RexxUtil library.'
End
Call SysLoadFuncs
END
Test = RxFuncQuery('GrxLoadFuncs')
IF Test >< 0 THEN
Do
Call RxFuncAdd 'GrxLoadFuncs', 'GRXUTILS', 'GRXLOADFUNCS'
Call GrxLoadFuncs
End
/************************* End loading DLLs ****************/
SIGNAL ON HALT
Call SysCls
Say 'PID Client v1.00'
BEEP(250,250)
Say 'WARNING: This program is used to kill a process running on a remote machine.'
Say ' PLEASE use with caution!'
Say
Say
Say 'Enter the network name of the computer running PID Server to connect with:'
Pull Server
pipename = '\\' || Server || '\PIPE\SFOGG\PIDSERVER'
bufsize = 256
hpipe = GrxClientOpenNPipe(pipename, bufsize)
if hpipe = 0 then
do
Say 'Could not open named pipe to' Server
exit
end
Say
Say 'Sending a request for a process list'
Say ' NOTE: Depending upon condition of' server 'this could take some time'
Call PIPESEND 'L'
/*********************** Main loop ***************************/
DO FOREVER
Pull msg
IF msg = '' THEN
CALL HALT
Call PIPESEND msg
End
EXIT
/***************************PIPESEND*************************/
PIPESEND:
ARG msg
Say
writerc = GrxWriteNPipe(hpipe, msg)
IF writerc >< 0 then
DO
say 'Could not write to pipe.'
Call GrxClientCloseNPipe
exit
END
Else
Do until readmsg = '0000'
readrc = GrxReadNPipe(hpipe, 'readmsg')
IF readmsg >< '0000' THEN
Say readmsg
End
RETURN
/**************************HALT***********************/
HALT:
Say 'Exiting.......'
rc = GrxClientCloseNPipe(hpipe)
Call SysSleep 1
Exit