Home » Questions » Computers [ Ask a new question ]

Any way of changing Windows screen resolution via command line?

Any way of changing Windows screen resolution via command line?

I am using Microsoft's Live Mesh program to remotely access a PC running Windows 7, running on 2 screens: one with 1920x1080 and the other 1920x1200 resolution.

Asked by: Guest | Views: 45
Total answers/comments: 5
Guest [Entry]

"Use QRes then say,

QRes.exe /x:800 /y:600"
Guest [Entry]

"I found a Windows Powershell script sample*, provided by Microsoft Technet, that is able to change the screen resolution.

The best way to invoke it, I found, was from a separate Powershell script, that looks like this:

## This loads the function (defined in another script)
. C:\[YOUR-PATH]\Set-ScreenResolution

## invoke with width and height
Set-ScreenResolution -Width 1680 -Height 1050

(Note I had saved the Microsoft script as Set-ScreenResolution.ps1)

Then from the command line or Start->Run you can invoke the second Powershell script, which I named Invoke-Set-ScreenResolution.ps1 like this (the -noexit param is good at first for debugging, but you may want to remove it later on depending on whether you want the command window to close):

powershell -noexit -ExecutionPolicy Bypass & C:\[your-path]\Invoke-Set-ScreenResolution.ps1

*Original Source (no longer available)

*Wayback Machine Source"
Guest [Entry]

"None of the already mentioned tools had all that I needed, so I came up with my own solution: ChangeScreenResolution.exe

Examples:

Change screen resolution of all monitors to 800x600px

ChangeScreenResolution.exe /w=800 /h=600

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

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

Set color depth of display with index 1 to 16bit

ChangeScreenResolution.exe /b=16 /d=1

Quick overview of the options:

Possible options (you can set OR query)
Setting options
/w=<width> Width in pixel eg 800
/h=<height> Height in pixel eg 600
/f=<frequency> display refresh rate eg 60
/b=<bpp> bits per pixel eg 32

Querying options
/l list all connected display devices
/m list all available mode settings

Filtering options
/d=<device> devices to modify/query, separated by comma, eg:
all (default)
0 (monitor with index 0, see option /l)
0,2 (monitors with index 0 and 2)
\\.\DISPLAY1 (name of display, see option /l)"
Guest [Entry]

"While somebody already mentioned Nirsoft's nircmd, the best tool from Nirsoft for this purpose is MultiMonitorTool.

It supports multi-monitor, saved configurations, 32 and 64 bit, changes in resolution, activation and orientation, etc."
Guest [Entry]

"Worthy to note the solution through built-in wmic command of Windows Management Instrumentation

wmic desktopmonitor create screenheight=1024, screenwidth=768

Though can result in:

ERROR:
Description = Provider is not capable of the attempted operation

in some ""providers"""