2

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 Answers 4

5

Try:

nircmd.exe setdisplay 800 600 32

or

nircmd.exe setdisplay 800 600 16
2
  • It has been awhile since I have needed this, but now curious if this was my issue at the time. When I get a moment, I will check to see if this fixes said issue, and will let you know.
    – NinjaKC
    Sep 15, 2015 at 6:06
  • Thank you!! I don't think I would have thought of this one on my own. At least not for a while. I think it would be more reasonable if the color depth was an optional parameter. Like, "just use the current value if not specified." I've been using nircmd for over a decade and still finding it useful for new things.
    – Nate
    Jan 19, 2018 at 21:31
5

To refine the answer of Matthew, the key point is that many recent video cards don't accept a color depth of 24 bits at certain resolutions, most of them use 32 bits. That will explain why nircmd.exe setdisplay 800 600 32 will work but nircmd.exe setdisplay 800 600 24 will not. And in that case Nircmd doesn't reply with an error code, the command is accepted but nothing is changed on the display.

Also all the examples in the Nircmd documentation refer to 24 bit or 8 bit, which can cause some frustration until you try with 32.

0

There are a few other command-line desktop resolution switchers you can try. One of them is bound to work for you.

(Source, but I had to Google for updated links.)

0

This works on Windows 10: https://12noon.com/

Commands example:

  1. Create "active" monitor(s) settings as XML:

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

  2. Load settings:

    start /wait "" dc2.exe -configure="DefaultSettings.xml"

^^ This will 1) write your current monitor configuration to an XML file and 2) load those same settings instantly. It really helps to put command 2) into a batch file and run on demand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.