home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
splms130.zip
/
KILLBN.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-01-24
|
836b
|
30 lines
/* program: killbyname (a freeby)
** written: Stan J. Towianski
** purpose: killbyname arg, will kill the 1st process that matches the
** name given in arg.
** date: 1995
** note: needs to have kill.exe program in path.
** This can be found in c:\grpware\clients from OS/2 Warp 3.0
** Also uses hardcoded filename of c:\out which can be
** changed.
*/
parse upper arg searchname
listfile = "c:\out"
"pstat /c > c:\out"
Do While( lines( listfile ) )
word = linein( listfile )
parse var word pid . . procname rest
say "pid ="pid "procname ="procname"="
if ( pos( searchname, procname ) > 0 ) then
Do
decpid = x2d( pid )
"kill "decpid
leave
End
End
rc = stream( listfile, 'c', "close" )
"del "listfile