Windows background process shows open software - how to close

Started by mjwillyone, August 20, 2021, 05:09:36 AM

Previous topic - Next topic

mjwillyone

Hello,

I am having an issue automating a program that, once I export an Excel from it, closes but remains in the background processes listing.   When I have other Winbatch scripts test for its open state to decide it the log-in procedure should be used, Winbatch sees it as open and starts to work.

It doesn't work, obviously, because there are no windows from the software open, etc.

Is there a way to test for the background process and kill it if I KNOW the software has been shut down?  The shut down, by the way, is successful.  It's just for some reason that when I export, this is a problem.  I have tested closing the Excel export file and Excel before I close the other program .. neither fixes the background process issue.

Can anyone help?

Thanks!
Mike

td

Some processes are designed to run detached once the UI is closed and others are just buggy. You may want to research why it is happening before randomly killing the process. Speaking of killing, if you decide to kill the process you already have the answer to your question. Please review the Process class methods for the class used in the example provided to you in your previous topic.

https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.kill?view=netframework-4.8

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

mjwillyone

Thank you.  I'm not sure why this program only continues running the process after a file is exported.  I was able to kill the program and make this work!