How can I script a screen resolution change, for example to 1024*768?

link|improve this question

79% accept rate
feedback

4 Answers

up vote 2 down vote accepted

There isn't a native powershell way to set the resolution. You could write in-line C# code in a powershell script to do it. Otherwise you would need to find a third party commandline application that does it and just call that from your script.

link|improve this answer
How do I change the resolution from C#? Is there a class? – Andrew J. Brehm Aug 26 '09 at 8:52
Did you follow the links that Splash provided? – EBGreen Aug 26 '09 at 11:50
feedback

As EBGreen has said, Powershell cannot do it in its vanilla state. However being a .NET-based shell, you could either use .NET within a powershell script, use a traditional CLI application or write a Cmdlet to do it.

These links may help you out if you decide to explore those paths further:

link|improve this answer
feedback

See the freeware QRes :

Description: Command line utility to change screen resolution, color depth and refresh rate...

For the case of multiple monitors, you can see Display Changer (free for personal and educational use):

Display Changer changes the display resolution, runs a program, then restores the original settings. It can also change the resolution permanently and rearrange the monitors in a multiple-monitor setup. This is useful for games and home theater computers.

link|improve this answer
feedback

You can't do this using a native Windows command, but you can use an application invoked from the command line like http://www.pcdownloadworld.com/prgdb/reschange.htm .

I've used it before - it is a little cumbersome but does what it says on the tin.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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