Kill OS/2 VDM 
Author Message
 Kill OS/2 VDM

Is there a way to use rexx commands to close (kill) a DOS program
running in an OS/2 DOS session (VDM)?

---------------------------------------------------------------------

Fred Springfield                         for e-mail
Plymouth, MN                             remove the 'xxx'

---------------------------------------------------------------------



Mon, 05 Feb 2001 03:00:00 GMT  
 Kill OS/2 VDM

Quote:

> Is there a way to use rexx commands to close (kill) a DOS program
> running in an OS/2 DOS session (VDM)?

You could use PSTAT /C into a REXX queue, parse it for the program you
want, extract the PID and then execute a command to kill it via a
utility like KILLPID.EXE, but I doubt the shutdown would be very
clean.

for starters:

/* */
 foundNetscape = '0'
 'pstat |RXQUEUE >NUL'      /*put running info in system stack*/
 do while queued() > 0        /*read each line of the stack*/
    parse pull myLine
    say myLine
    parse var myLine  pid  ppid   sessionID  procName  .
    if procName = 'C:\PCOMOS2\PCSWS.EXE' then do
        foundNetscape = '1'         /*yes it is running*/
        leave                       /*look no further*/
    end
 end
 if foundNetscape then do
     say 'Yep, found PCOMM'
     signal EOJ
 end
 if foundNetscape \= '1' then do
   say 'Nope, no 3270'
 end
EOJ:
  return

=Dwight=
X1=L, X2=L & the domain is phonetic



Mon, 05 Feb 2001 03:00:00 GMT  
 Kill OS/2 VDM

Quote:



>> Is there a way to use rexx commands to close (kill) a DOS program
>> running in an OS/2 DOS session (VDM)?

>You could use PSTAT /C into a REXX queue, parse it for the program you
>want, extract the PID and then execute a command to kill it via a
>utility like KILLPID.EXE, but I doubt the shutdown would be very
>clean.

>for starters:

>/* */
> foundNetscape = '0'
> 'pstat |RXQUEUE >NUL'      /*put running info in system stack*/
> do while queued() > 0        /*read each line of the stack*/
>    parse pull myLine
>    say myLine
>    parse var myLine  pid  ppid   sessionID  procName  .
>    if procName = 'C:\PCOMOS2\PCSWS.EXE' then do
>        foundNetscape = '1'         /*yes it is running*/
>        leave                       /*look no further*/
>    end
> end
> if foundNetscape then do
>     say 'Yep, found PCOMM'
>     signal EOJ
> end
> if foundNetscape \= '1' then do
>   say 'Nope, no 3270'
> end
>EOJ:
>  return

I just tried running pstat with 3 DOS sessions (VDM's) open, but pstat
does not report them.  It seems to only report OS/2 processes which
are running.

Have I missed something?

---------------------------------------------------------------------

Fred Springfield                         for e-mail
Plymouth, MN                             remove the 'xxx'

---------------------------------------------------------------------



Thu, 08 Feb 2001 03:00:00 GMT  
 Kill OS/2 VDM

Quote:



>>> Is there a way to use rexx commands to close (kill) a DOS program
>>> running in an OS/2 DOS session (VDM)?

>>You could use PSTAT /C into a REXX queue, parse it for the program you
>>want, extract the PID and then execute a command to kill it via a
>>utility like KILLPID.EXE, but I doubt the shutdown would be very
>>clean.

>>for starters:

>>/* */
>> foundNetscape = '0'
>> 'pstat |RXQUEUE >NUL'      /*put running info in system stack*/
>> do while queued() > 0        /*read each line of the stack*/
>>    parse pull myLine
>>    say myLine
>>    parse var myLine  pid  ppid   sessionID  procName  .
>>    if procName = 'C:\PCOMOS2\PCSWS.EXE' then do
>>        foundNetscape = '1'         /*yes it is running*/
>>        leave                       /*look no further*/
>>    end
>> end
>> if foundNetscape then do
>>     say 'Yep, found PCOMM'
>>     signal EOJ
>> end
>> if foundNetscape \= '1' then do
>>   say 'Nope, no 3270'
>> end
>>EOJ:
>>  return

>I just tried running pstat with 3 DOS sessions (VDM's) open, but pstat
>does not report them.  It seems to only report OS/2 processes which
>are running.

This was probably already answered (since Fred told me about it - thanks :) )
but Fred found rxx19.zip by Dion Gillard at Hobbes that handles this nicely.

Hopefully this info will benefit other NG readers

J. Pedone

http://www.flash.net/~jpedone

I use Windows...on my car, on my house, but not on my ...
A list is only as strong as its weakest link.  - Don Knuth



Thu, 08 Feb 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Can Rexx kill a VDM ?

2. os._exit(), os.kill(os.getpid(), 9)

3. OS/2 REXX and DOS VDM's

4. killing a Rexx process in OS/2

5. Kill() command in OS/2 REXX ?

6. os.kill on NT

7. os.kill()

8. os.kill........

9. a patch to kill a thread in any OS

10. os.kill for win32

11. Kill the kill file for now

12. Thread#kill doesn't kill processes inside a thread

 

 
Powered by phpBB® Forum Software