Run command on system event?

Oct 14, 2018
27
0
30
So basically I'm trying to execute a command when a system event takes place. I want to switch my active display to my monitor with %windir%\System32\DisplaySwitch.exe /external when the system detects a specific event, and then switch my active display to my TV with %windir%\System32\DisplaySwitch.exe /internal when another specific event happens. I can see these specific events happening in DebugView, but I'm not sure how I could make my system execute a command when it sees these events happen. Does anybody know how to accomplish this?
 

gardenman

Splendid
Moderator
Hi, you might be able use to a Scheduled Task to do this. It really depends on how what you mean by "system event". I haven't looked at DebugView.

Here's a program you might want to look at:
https://www.nirsoft.net/utils/full_event_log_view.html

Open Task Scheduler. Choose Create Task, go to the Trigger tab, click New at the bottom, for Begin the task choose On an event. Select the event or set it however you need.

Then go to the Actions tab and choose New at the bottom. Set your program and arguments (parameters) for it.

You'll probably need to choose several other settings so look through all of the task settings.

I don't know if this will work out for you or not. If not, others are always welcome to give an answer.