Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Using a windows 7 laptop when I switch off/disconnect & reconnect my external monitor, or after getting the laptop out of sleep mode sometimes the screen resolution is all wrong and if I go to display settings the external monitor hasn't been recognised properly and I can't set it to its ideal resolution. To fix this I have to unplug and plug back in again.

Is it possible to set up a keyboard shortcut/batch file to set the screen to its ideal resolution (either by having the system do a redetect without unplugging or by just overriding the settings the system uses with a hard-coded value I set myself).

share|improve this question

1 Answer 1

Nircmd is a nice command line utility that can help. It has an option to set screen resolution and even accepts options to set a specific monitor to a specific resolution.

If you read through the documentation then it appears you can create a command shortcut with Nircmd that you should then be able to modify to add a shortcut to. Look for the "cmdshortcut" command.

setdisplay {monitor:index/name} [width] [height] [color bits] {refresh rate} {-updatereg} {-allusers}

Changes your display settings. The [width] and [height] parameters represents the number of pixels on your screen. The [color bits] parameter represents the number of colors shown on your screen (8 - 256 color, 16 - 16bit color, 24 - 24bit color, and so on). {refresh rate} is an optional parameter that specifies the monitor refresh rate. If you specify the {-updatereg} parameter, the new settings will be saved in the Registry. If you specify both {-updatereg} and {-allusers} parameters, the new settings will be saved in the Registry for all users. If you have multiple monitors, you can use the optional monitor parameter, which specifies for which monitor you want to change the display settings. You can specify the monitor by index (0 for the first monitor, 1 for the second one, and so on) or by specifying a string in the system monitor name. The monitor name can be found in the Device manager of Windows: Right click on the monitor item, and then choose 'Properties'. The string displayed in the 'location' field is the monitor name.

Examples:
- nircmd setdisplay 800 600 24 -updatereg
- nircmd setdisplay 1024 768 24 90
- nircmd setdisplay 1024 768 8
- nircmd setdisplay monitor:1 1024 768 24 90
- nircmd setdisplay monitor:name1 1024 768 24 90

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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