简体   繁体   English

Windows批处理文件以更改监视器设置

[英]Windows batch file to change monitor settings

I have a desktop computer that is hooked up to 3 different monitors of which only two can be active at any one time. 我有一台连接了3个不同显示器的台式计算机,其中任何一次只能激活两个。 One is a primary monitor and is always active. 一个是主监视器,并且始终处于活动状态。 I can manually switch between the other two: one a monitor, another an HDTV. 我可以手动在其他两个之间切换:一个是监视器,另一个是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. 该开关是一个机械开关,仅处理VGA(此时仅实际切换了RGB组件),因此没有其他设备对计算机的反馈,因此Windows无法进行任何自动调整来更改分辨率和诸如此类的操作那。

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 -Faken

Try reschangecon (yes, there is a console version!). 尝试使用reschangecon(是的,有一个控制台版本!)。 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) http://www.12noon.com/displaychanger.htm (免费供个人使用)

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 我使用ResSwitch在我朋友的HTPC上执行此操作,该HTPC定期忘记以什么分辨率驱动他的电视,您这样称呼它:resswitch.exe 1920 1080 32 60

http://www.naughter.com/qres.html 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. 风险是它不会要求您确认,因此最好确保显示器可以处理您所要求的分辨率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM