Jump to content

Powershell script to move sensorpanel to specific monitor


CerN

Recommended Posts

I got sick of the Sensorpanel opening on the wrong monitor, even with the built in pin feature, that I decided to try and write a powershell script to avoid the issue.
This is written with a lot of help from chatgpt.

I have attached the powershell script. It should be edited at the top with your desired screen width and height.
The script will look through your connected monitors and find one that matches your desired resolution.
It will then move and resize your panel to that monitor.

If you have more than one monitor with the same resolution as your desired res, then I don't know... I have not taken that into account.

If the sensorpanel hasn't started yet, it will loop until it finds it.

NOTE: It requires to be run as administrator to work.

It can be run on boot with task scheduler. This is my setup:

image.png.27f22feb812c303cfb8a0d9aa74a9a03.png

 

image.png.c7e3b85b0d7ddb749d870ab6691b19b4.png

image.thumb.png.376249755b33dba22259948b29b9210e.png

The argument should be: /c start /min "" powershell -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\SensorPanelMoverLoop.ps1"
<--- Edit to match the path to where you saved the script.

The reason we start it this way through CMD is to avoid the powershell window to flash open on boot.

The rest can be left default.
Hopefully this helps someone else besides me!
 

SensorPanelMoverLoop.ps1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...