1

I have run into a windows exe called nircmd which allows you to do some pretty cool stuff through the command line. I have a project I am assisting in, and am needing to resize a Windows environment on the fly, taking whatever is maximized and making it maximized after the resize. When searching the internet, I stumble upon nircmd a lot, but I can not seem to get the function I need working, to work on it. It is:

setdisplay 800 600 24

I have tried every different option with this function within nircmd, and it does nothing on both a Windows 7 environment, nor a Windows Server where it needs to go. I have googled for "nircmd setdisplay not working" or "nircmd setdisplay error" etc, and can find nothing regarding it on the internet. I find this weird, because I have tested this on my desktop, laptop, and a windows server, and all 3 do nothing.

Can anyone assist me in what I may be doing wrong? Or point me in a direction of a command line driven, on the fly resolution changing program? (I have tried QRes as well, with the same results, though the Windows Server gives me an error (which I don't recall at the moment). It must be command line driven, as this is a simple function that will be inside a php file and only accessed by a few in the end.

4

4 回答 4

5

尝试:

nircmd.exe setdisplay 800 600 32

或者

nircmd.exe setdisplay 800 600 16
于 2014-04-30T14:08:04.227 回答
4

为了完善 Matthew 的答案,关键是许多最近的视频卡在某些分辨率下不接受 24 位的色深,其中大多数使用 32 位。这将解释为什么nircmd.exe setdisplay 800 600 32会起作用但nircmd.exe setdisplay 800 600 24不会。在这种情况下,Nircmd 不回复错误代码,命令被接受,但显示屏上没有任何变化。

此外,Nircmd 文档中的所有示例都指的是 24 位或 8 位,这可能会导致一些挫败感,直到您尝试使用 32 位。

于 2016-10-20T10:05:57.157 回答
0

您可以尝试其他一些命令行桌面分辨率切换器。其中之一一定会为您工作。

来源,但我不得不谷歌更新链接。)

于 2013-02-13T13:01:56.723 回答
0

这适用于 Windows 10:https ://12noon.com/

命令示例:

  1. 将“活动”监视器设置创建为 XML:

    dc2.exe -create="DefaultSettings.xml" -active

  2. 加载设置:

    开始 /wait "" dc2.exe -configure="DefaultSettings.xml"

^^ 这将 1) 将您当前的监视器配置写入 XML 文件并 2) 立即加载相同的设置。将命令 2) 放入批处理文件并按需运行确实很有帮助。

于 2020-03-19T17:31:47.227 回答