Author Topic: Windows background process shows open software - how to close  (Read 202 times)

mjwillyone

  • Jr. Member
  • **
  • Posts: 50
Windows background process shows open software - how to close
« on: August 20, 2021, 05:09:36 am »
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

  • Tech Support
  • *****
  • Posts: 3952
    • WinBatch
Re: Windows background process shows open software - how to close
« Reply #1 on: August 20, 2021, 07:24:12 am »
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

  • Jr. Member
  • **
  • Posts: 50
Re: Windows background process shows open software - how to close
« Reply #2 on: August 23, 2021, 08:34:57 am »
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!