Finding and killing a process

Started by siocnarf, March 29, 2022, 07:42:43 AM

Previous topic - Next topic

siocnarf

Hi,

How would I test if the process javaw is in memory then killing it?

Thanks,

td

There are multiple ways. Check out the AppExist function:

https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/WILAK_A__005.htm

Another approach is to use the Process Extender's tListProc function:

https://docs.winbatch.com/mergedProjects/Process/Process/PROCESS_T__002.htm

There are other approaches as well.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

siocnarf

Hi,

And what would be the correct way to kill that process?

Thanks,

td

If you look in the Consolidated WIL Help file on your computer in the table of contents under "Windows Interface Language Reference -> Functions -> By Type -> Process Control",  you will notice the function "TerminateApp".  Assuming you have the correct process name or window name and your process is a regular Windows application, it should be suggestive...
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

Also, if you need to kill the process without using the process name The Process Extender has the "tKillProc" function. There are several other approaches including using WIL CLR hosting capabilities and the "System.Diagnostics.Process" class. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade