Windows batch file to change monitor settings

别等时光非礼了梦想. 提交于 2019-12-12 10:12:37

问题


I have a desktop computer that is hooked up to 3 different monitors of which only two can be active at any one time. One is a primary monitor and is always active. I can manually switch between the other two: one a monitor, another an HDTV.

The switch is a mechanical switch which only handles VGA (and at that, only the RGB components are actually switched) so there is no feedback to the computer from the other devices, thus windows can not make any automatic adjustments to change resolutions and things like that.

I want to make a batch file that will automatically switch the screen configurations and resolutions (hard coding the proper resolutions of course since we can't detect the other devices anyways) so that they are correct for the displays.

Where is the best place to get started? Where can I find library of commands (or whatever they are called) to do something like this? Lastly, is there anything I should be careful about when attempting something like this?

Thanks in advance,

-Faken


回答1:


Try reschangecon (yes, there is a console version!). It is safe, because it won't let you set settings that are not supported (without the force flag).

http://www.12noon.com/displaychanger.htm (It is free for personal use)




回答2:


I've used ResSwitch to do this on my friend's HTPC that periodically forgot what resolution to drive his TV at, you call it like this: resswitch.exe 1920 1080 32 60

http://www.naughter.com/qres.html

The risk is it doesn't ask you to confirm, so you better be sure your monitor can handle the resolution you're asking for.



来源:https://stackoverflow.com/questions/1490004/windows-batch-file-to-change-monitor-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!