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.
Need to check if a process is currently running
Need to check if a process is currently running
I'm trying to create a macro which requires a process detecting action. For example, I need to know if Windows Media Center is currently open. Whether a process is running or not will determine if the macro can be executed. I thought process watcher might be what I need, but I can't figure out how to make it do anything.
Re: Need to check if a process is currently running
You could use the process watcher plugin, but it would not tell you if the process was started before eventghost was started.
I made a script a log time ago specifically to see if windows media center currently running and/or recording. This requires you to use Windows Management Instrument (WMI). I have the wmi.py file attached. It needs to be put in the main eventghost install directory.
To see if WMC is running use:
To see if WMC is recording:
I made a script a log time ago specifically to see if windows media center currently running and/or recording. This requires you to use Windows Management Instrument (WMI). I have the wmi.py file attached. It needs to be put in the main eventghost install directory.
To see if WMC is running use:
Code: Select all
import wmi
c = wmi.WMI ()
for process in c.Win32_Process (name="ehShell.exe",sessionId="1"):
print "WMC is recording"To see if WMC is recording:
Code: Select all
import wmi
c = wmi.WMI ()
for process in c.Win32_Process (name="ehrec.exe",sessionId="0"):
print "WMC is Running"- Attachments
-
- wmi.py
- (46.56 KiB) Downloaded 127 times