Hi guys,
I'd like to do something which shouldn't be a problem for the experts here.
As I'm not, I'm just gonna ask:
I want to execute some macros just in case a special process is running.
If it's not the macro should stop.
I have several use cases for this. E.g. sometimes mediaportal won't close on close command so I want to check the macro a few seconds later if it is still running. If so I would run a kill.bat
Could you please help me out?
Thanks
Luca
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
How to check status of process
- Luca Brasi
- Experienced User
- Posts: 262
- Joined: Sat Oct 11, 2008 12:39 pm
How to check status of process
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi
- Luca Brasi
- Experienced User
- Posts: 262
- Joined: Sat Oct 11, 2008 12:39 pm
Re: How to check status of process
Hey guys,
come on, this should be a no-brainer for you! Would be very grateful for some help!
Thanks
Luca
come on, this should be a no-brainer for you! Would be very grateful for some help!
Thanks
Luca
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi
- Luca Brasi
- Experienced User
- Posts: 262
- Joined: Sat Oct 11, 2008 12:39 pm
Re: How to check status of process
Sorted it out:
Code: Select all
from win32com.client import GetObject
WMI = GetObject('winmgmts:')
eg.result = len( WMI.ExecQuery('select * from Win32_Process where Name="mediaportal.exe"') ) > 0Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi
Re: How to check status of process
Thanks Luca for posting the solution. I didn't realize that I needed something like this until you posted the code.
- Luca Brasi
- Experienced User
- Posts: 262
- Joined: Sat Oct 11, 2008 12:39 pm
Re: How to check status of process
Thanks for your reply kalia.
Just want to mention that I took it from this german post
Just want to mention that I took it from this german post
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi