WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: mcjathan on August 04, 2015, 01:32:54 PM

Title: Use RunShell @GETPROCID to Later Terminate the Specific Program?
Post by: mcjathan on August 04, 2015, 01:32:54 PM
Greetings,  I have a Winbatch command that looks like this:

   Pid = RunShell(prog, params, "", @ICON, @GETPROCID)

I may have more than one instance of prog running (from different RunShell commands), but I want to be able to have Winbatch terminate the specific instance of prog associated with Pid without affecting the other instances of prog.  Is this possible?

It appears that the function AppExist() is equipped to accept Pid as an input.  However, it looks like the function TerminateApp() is NOT equipped to accept Pid as an input.  Am I misunderstanding TerminateApp()?  Or, is there some other way to terminate the specific instance of prog that is specifically associated with Pid?

Regards,  Jeff
Title: Re: Use RunShell @GETPROCID to Later Terminate the Specific Program?
Post by: td on August 04, 2015, 05:34:43 PM
Check out the following:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WIL~Extenders/Process~ID+tOpenProc~Error~220~When~Trying~toTerminate~a~Process.txt (http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WIL~Extenders/Process~ID+tOpenProc~Error~220~When~Trying~toTerminate~a~Process.txt)