1

As the title says, I’d love if someone could help me out with this current issue of mine. I need a way to have my batch file be able to auto execute an .exe as soon as a certain display is detected.

For example Acer34 35 inch, gets detected to then execute a certain .vbs, but when I — for example — switch aka turn off that display and switch to my TV for example Sony Bravia 50 inch, it’ll launch a different .vbs that is tied to that display and this on loop of course said .vbs then launching a certain .exe per batch , depending on what Displays been activated.

Display always show as Display 0 of course since either or is powered on, would appreciate the help.

This is what I have so far:

 @echo OFF
::Launch the Display Profile depending on Display detected
:Display Detection
wmic desktopmonitor get Name if "desk display model" start "" ".\Launch Display Config for Desk Display Hidden.vbs"
wmic desktopmonitor get Name if "tv display model" start "" ".\Launch Display Config for TV Hidden.vbs"
if "%1"=="Launch Display Config for Desk Display" call "Launches either TV or Desk Display Config"
if "%1"=="Launch Display Config for TV" call "Launches either TV or Desk Display Config"
Goto Display Detection
  • You will need some way of detecting the screen connection. You could look to see if an Event is triggered on display connection, and use that event to trigger a scheduled task. – music2myear May 25 '21 at 03:50
  • what? no....it needs something like this https://superuser.com/questions/1234471/how-can-i-easily-get-the-manufacturer-and-model-of-my-monitor , but i cant get it figured out aka integrated as you can tell – Etherpixel56 May 25 '21 at 03:54
  • anyone please ? – Etherpixel56 May 28 '21 at 06:59
  • wmic desktopmonitor , dont work all i get is generic pnp monitor as return ....so recon needs a different command also – Etherpixel56 May 28 '21 at 19:37
  • well ive been trying to figure it out ...yet still no proper solution , check out my reddit thread about it> https://www.reddit.com/r/PowerShell/comments/nndngf/run_a_scriptbatch_when_monitor_changes/h08orja/ – Etherpixel56 Jun 07 '21 at 08:47
  • still would appreciate some help here thanks – Etherpixel56 Jun 23 '21 at 15:45

0 Answers0