So I need to kill a process given a particular flag being set.
I figured this would be easy in REXX, and most likley would rely on a suitable API call or a built-in function. However, no such thing has been found (REXX newbie here, so take it easy...
)
But, I did start looking at RXU library, indeed, I can see that I could use:
dosrc = RxQProcStatus(stemname [,flags])
to get the equivalent of PSTAT result.
From there I could fish out the matching record for a particular module (an EXE in my case) and once I have the PID I could call:
killrc = RxKillProcess(pid [, action])
But all this still seems a little convoluted, I mean is there no simpler way to kill a process than having to point to it by a PID? Yes, I understand the reason for this, but if I have a single instantiation of a particular EXE I know that killing it by module name is just fine.
Any suggestions where to look next?
Oh, sure, I could call one of the utilities that do this, but I was hoping to push my REXX "boundaries" a tad and see how this could be implemented, any suggestions?
Thanks!