I want to schedule a windows task to run when a secondary output device (e.g., VGA monitor or HDMI A/V receiver is turned on or off) but I'm not sure which event should be used for this. I found something related to network cable plug/unplug here How to launch a command on network connection/disconnection? , but nothing for external audio/video devices. Any such event or events exist? If not, any other way to do this? Thanks
Asked
Active
Viewed 1,616 times
1 Answers
1
Following on from your link above, I found that I could get this working for audio devices using the following event data:
Log: Microsoft-Windows-DeviceSetupManager/Admin
Source: DeviceSetupManager
Event ID: 112
ID 112 seems to process newly connected devices. In Windows logs I had the following:
Device 'LG-BDHT' ({db41aaf1-ce7e-5de5-904e-9b6d7560d7ba}) has been serviced, processed 4 tasks, wrote 0 properties, active worktime was 427 milliseconds.
This event seems to occur when I turn on my Bluray player (which then allows pass through access to my TV as a monitor).
Hope this could help you get things working! Worst case scenario, look through you event logs for something that happens around the time that your TV turns on.
wonea
- 1,817
- 1
- 23
- 42
dansimpson
- 11
- 1
-
1I know this is old, but in case it helps any others that don't plan to check the event viewer for their details, I didn't see anything in `Log: Microsoft-Windows-DeviceSetupManager/Admin`. The two displays I plugged into my HDMI port gave me results from the "System" log (`Event Viewer > Windows Logs > System`). The corresponding values above would be `Source: Display` and an `Event ID: 4107` in my case. Note: They both appear when connecting and disconnecting the monitors. – Darrel Holt Mar 27 '18 at 22:33