windows 更改计算机分辨率的批处理命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15324290/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 10:20:26  来源:igfitidea点击:

Batch command to change the resolution of a computer

windowsbatch-filecommand-linescreen-resolution

提问by user2144638

I want to write a command in a batch file which changes the resolution of a computer. I am using Windows XP.

我想在批处理文件中编写一个更改计算机分辨率的命令。我使用的是 Windows XP。

I need to set the resolution as 1024*768.

我需要将分辨率设置为 1024*768。

回答by Next Door Engineer

You can use either of the following two tools.

您可以使用以下两种工具之一。

  1. MultiRes
  2. QRes
  1. 多分辨率
  2. QRes

Using MiltiRes:

使用 MiltiRes:

multires.exe /800,600,32,75

Using QRes:

使用 QRe:

QRes.exe /x:800 /y:600

回答by Alexander Taubenkorb

I needed more options, so I developed ChangeScreenResolution.exeto change the screen resolution in a batch file.

我需要更多选项,因此我开发了ChangeScreenResolution.exe来更改批处理文件中的屏幕分辨率。

Examples:

例子:

Change screen resolution of all monitors to 800x600px

将所有显示器的屏幕分辨率更改为 800x600px

ChangeScreenResolution.exe /w=800 /h=600

Change screen resolution of all monitors to 800x600px with refresh rate of 60Hz and 32bit color depth

将所有显示器的屏幕分辨率更改为 800x600px,刷新率为 60Hz,色深为 32 位

ChangeScreenResolution.exe /w=800 /h=600 /f=60 /b=32

Set resolution of display with index 1 to 800x600px

将索引为 1 的显示分辨率设置为 800x600px

ChangeScreenResolution.exe /w=800 /h=600 /d=1

To list all available displays (and their indexes):

列出所有可用的显示(及其索引):

ChangeScreenResolution.exe /l

回答by Dave A-W

I haven't tried MultiRes, but note that Qres will only run on 32-bit machines.

我还没有尝试过 MultiRes,但请注意 Qres 只能在 32 位机器上运行。

DisplayChanger II from 12noon.comalso works beautifully and is free for personal use.

来自 12noon.com 的 DisplayChanger II也可以很好地工作,并且可以免费供个人使用。

DisplayChangeris designed to be called via command line or batch script, and has both 32-bit and 64-bit versions. It can also generate editable config files specifically for multi-monitor (or projector) setups. You manually set the displays up how you want, "create" a config for it, then call that configuration up at any time.

DisplayChanger旨在通过命令行或批处理脚本调用,并且具有 32 位和 64 位版本。它还可以专门为多显示器(或投影仪)设置生成可编辑的配置文件。您可以手动设置显示方式,为它“创建”一个配置,然后随时调用该配置。

回答by Jaco D.

I have written a script which uses the program provided by Alexander Taubenkorbin his answerto fix monitor black screen issue due to "screen resolution out of monitor range" caused by StarCraft not reverting my desktop resolution back to its original settings on exit.

我写了一个脚本,它使用Alexander Taubenkorb他的回答中提供的程序来修复由于“屏幕分辨率超出显示器范围”而导致的显示器黑屏问题,因为星际争霸在退出时没有将我的桌面分辨率恢复到其原始设置。

Here's the .bat content - feel free to use it.

这是 .bat 内容 - 随意使用它。

taskkill /f /IM explorer.exe

%~dp0%\Starcraft.exe

start explorer.exe

REM *change below /w=XXX & /h=XXX values that reflect your monitor's needs* 

ChangeScreenResolution.exe /w=800 /h=600 

REM *this is the minimum resolution of monitor - brings desktop back to life*

ChangeScreenResolution.exe /w=1024 /h=768

REM *this is the recommended & preferred resolution I like to run my monitor at*

exit

回答by eight Stacker

you can also use wmic desktopmonitor like here

你也可以像这里一样使用 wmic desktopmonitor