ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Need a script to auto detect display

(1/2) > >>

glasskuter:
Hi Guys, I have an old kvm switch  that does not have active ddm so I am always having to go to screen resolution and  "detect display"
so that I have the proper resolution..
Could someone help me write a script that I could make a shortcut to that would accomplish this.  Also, since I don't know anything about scripts, do I need some sort of program to run it?
Thanks

4wd:
If you open a Powershell console you can try the following:


--- Code: PowerShell ---Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorBasicDisplayParams
Attached is a script with the command and a shortcut to run it.

You should get something similar to the following output, (output for each monitor connected):


--- Code: Text ---Active                        : TrueDisplayTransferCharacteristic : 120InstanceName                  : DISPLAY\VSCD920\5&22dca72a&0&UID261_0MaxHorizontalImageSize        : 41MaxVerticalImageSize          : 26SupportedDisplayFeatures      : WmiMonitorSupportedDisplayFeaturesVideoInputType                : 1PSComputerName                : Active                        : TrueDisplayTransferCharacteristic : 120InstanceName                  : DISPLAY\DEL4005\5&22dca72a&0&UID262_0MaxHorizontalImageSize        : 34MaxVerticalImageSize          : 27SupportedDisplayFeatures      : WmiMonitorSupportedDisplayFeaturesVideoInputType                : 1PSComputerName                :  Press a key to exit ...
If it works and you don't want the output:

--- Code: PowerShell ---Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorBasicDisplayParams | Out-Null

MilesAhead:
I was under the impression the OP wanted something that would put the monitor into the desired resolution without having to drill down manually into the setting.  But I could be mistaken.

My Belkin kvma switch used to set the screen mode when switching to another machine, even if the monitor was already in the desired mode.  There was some reason they did it that way but I can't remember it now.  :)

4wd:
I guess it depends how you read it:

... I am always having to go to screen resolution and  "detect display"
so that I have the proper resolution..-glasskuter (July 14, 2015, 03:27 PM)
--- End quote ---

I read it as the system doesn't automatically detect the native resolution of the monitor, (so defaults to 1024x768 or something), because DDC isn't being resent/requested on switch-over, so telling the system to go identify monitors should get it resent and fix the resolution.

@glasskuter: Can you clarify what you mean, (eg. you need to set resolution also)?

glasskuter:
4wd your script does exactly what I needed. Wish I had found this site a long time ago. Excellent work.  I really appreciate your time and effort on my part.  I wish I was as proficient in dealing with code.  I hope all fellow kvm users find this solution.  Thank you so much.

Navigation

[0] Message Index

[#] Next page

Go to full version