Monday, November 5, 2012

Change screen resolution and desktop background with command prompt

Its been a few years since I wrote a useful post. Here is something I wanna and feel a need to share.

Me and my brother share the same computer, and we always have different preference for resolution and desktop background. This guide, I will tell you how I went about the problem. I'm gonna put one more on changing the theme after I've done googling. I'm on XP btw.

Every time I want to use the computer, I had to go through the tedious process of opening the display settings and so on. This amounts to many steps. 7 in total.

1.right click on desktop on properties on desktop tab desired bg on settings tab
6.slide to desired resolution

And I had to do this every time. So I created a simple batch file. With the batch file, I was able to reduce the 7 steps to 1 step.

It uses 2 third party software which are:

-by Nirsoft

-by Marty List

They can be downloaded here:

After downloading and packaging them, here is a sample batch file I made.

@echo off
cd /d C:\Downloads\
nircmd.exe setdisplay 1024 768 32 -updatereg
SetWallpaper.exe /D:S C:\WINDOWS\Web\Wallpaper\Bliss.bmp

Change "C:\Downloads\" to where you unpacked nircmd.exe and SetWallpaper.exe
Change the setdisplay parameter to weight height bitcolor
Change the path of the image (has to be .bmp format)
Save it to the desktop with .bat extension and you are done.

For more options, check out the Readme:

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

Included in the download
/r to remove wallpaper
/D:C|T|S to make it centered, tiled or stretched

actually, this post may not be that useful

No comments: