batch or registry file to change desktop setting

L

liu

The desktop settings (picture, color) are changed everytime the PC is
rebooted at the company I work for. I prefer black background (easier
for my eyes) so I have to set it manually. I wonder if there a way to
speed up the process by one mouse click that it changes back to what I
prefer?

Thanks for the help,
 
L

liu

Try a Google search for "batch file change background color xp"

and you'll find ideas like this:

http://www.daniweb.com/forums/thread65339.html

http://www.kellys-korner-xp.com/xp_tweaks.htm
Line 30.  Windows XP Doesn't Save User Settings

Thanks for the help, Joe.

I've identified (maybe wrong?) the registry items for setting desktop
color and Background picture, but I'm not sure the syntax for
registry.

My questions are:
what do you put if the value data is blank in Wallpaper? I tried 0
What do you put if the value data is RGB values such as 255 255 255
for black.

I tried like the ones below, but it didn't work.
REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D 0
REG ADD "HKCU\Control Panel\Colors" /V Window /T REG_SZ /F /D 255 255
255

Thanks for the help!
 
L

liu

Joe, thanks for the help. After reading and experimenting, I can the
following to update values of desktop color and wall paper in Regedit.
I have to use quotes in order to change the string inside. The only
thing is desktop color won't be undated until reboot (according to
web), while wallpaper gets updated right away.

reg add "HKCU\Control Panel\Colors" /v Background /t REG_SZ /d "0 0
0" /f
REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop" /V Wallpaper /T
REG_SZ /F /D ""
REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D
0
REG ADD "HKCU\Control Panel\Desktop" /V TileWallpaper /T REG_SZ /F /D
2
%SystemRoot%\System32\RUNDLL32.EXE user32.dll,
UpdatePerUserSystemParameters
 
T

Tim Meddick

Not too sure what you are trying to accomplish with this but, anyhoo.....


The correct syntax to set the Wallpaper value for no-wallpaper is ; "none"

so you might type :


reg ADD "HKCU\Control Panel\Desktop" /v Wallpaper /d "none" /f


......then, you can set the desktop base-color, which is only then visible
when there is no wallpaper defined (as above).....


reg ADD "HKCU\Control Panel\Colors" /v Background /d "57 105 165" /f


.....please note - I do *not* specify the REG_TYPE if it's the default
REG_SZ (non-expanded) only for the other reg-types (dword, multi, expand,
binary, & ect.,)

Also, here I gave the background color a value of the default Windows XP
desktop color (sort of a deep sky-blue).

Tip - pick a color using MS PAINT using the "Edit Colors" > "Define Custom
Colors" and then take a note of the Red, Green, Blue fields and then copy
them like above (i.e. Red=57 Green=105 and Blue=165 ) just remember "RGB"
for the relative position of the three numbers that make up the value.





==

Cheers, Tim Meddick, Peckham, London. :)




liu said:
Try a Google search for "batch file change background color xp"

and you'll find ideas like this:

http://www.daniweb.com/forums/thread65339.html

http://www.kellys-korner-xp.com/xp_tweaks.htm
Line 30. Windows XP Doesn't Save User Settings

Thanks for the help, Joe.

I've identified (maybe wrong?) the registry items for setting desktop
color and Background picture, but I'm not sure the syntax for
registry.

My questions are:
what do you put if the value data is blank in Wallpaper? I tried 0
What do you put if the value data is RGB values such as 255 255 255
for black.

I tried like the ones below, but it didn't work.
REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D 0
REG ADD "HKCU\Control Panel\Colors" /V Window /T REG_SZ /F /D 255 255
255

Thanks for the help!
 
L

liu

Thanks for you help, Tim.
Not too sure what you are trying to accomplish with this but, anyhoo.....
My office system has probably some kind of startup script that changes
my background color to blue and put a corporate desktop wallpaper. I
personally like the background set in black so it does not hurt my
eyes as much. So I would like to create a batch file that I change the
display settings with one mouse click.
so you might type :

reg ADD "HKCU\Control Panel\Desktop" /v Wallpaper /d "none" /f
I can only make it work if "" is used instead of "none". I'm on
Windows XP SP3.
reg ADD "HKCU\Control Panel\Colors" /v Background /d "57 105 165" /f
With this, I can see the value changed in Regedit but my system does
not update right away. Even if it should update after the next reboot,
the start script would write over it. So still not a solution.
....please note - I do *not* specify the REG_TYPE if it's the default
REG_SZ (non-expanded) only for the other reg-types (dword, multi, expand,
binary, & ect.,)
Also, here I gave the background color a value of the default Windows XP
desktop color (sort of a deep sky-blue).
...
Thanks for the tips.
 
T

Tim Meddick

The default value for :

[HKEY_CURRENT_USER\Control Panel\Desktop]
"Wallpaper"="none"

i.e. It actually says the word "none" for the value.

Quite right - if you want to delete the value, then you use double "quotes"
containing nothing ("").

==

Cheers, Tim Meddick, Peckham, London. :)




Thanks for you help, Tim.
Not too sure what you are trying to accomplish with this but, anyhoo.....
My office system has probably some kind of startup script that changes
my background color to blue and put a corporate desktop wallpaper. I
personally like the background set in black so it does not hurt my
eyes as much. So I would like to create a batch file that I change the
display settings with one mouse click.
so you might type :

reg ADD "HKCU\Control Panel\Desktop" /v Wallpaper /d "none" /f
I can only make it work if "" is used instead of "none". I'm on
Windows XP SP3.
reg ADD "HKCU\Control Panel\Colors" /v Background /d "57 105 165" /f
With this, I can see the value changed in Regedit but my system does
not update right away. Even if it should update after the next reboot,
the start script would write over it. So still not a solution.
....please note - I do *not* specify the REG_TYPE if it's the default
REG_SZ (non-expanded) only for the other reg-types (dword, multi, expand,
binary, & ect.,)
Also, here I gave the background color a value of the default Windows XP
desktop color (sort of a deep sky-blue).
...
Thanks for the tips.
 
Joined
Nov 18, 2011
Messages
2
Reaction score
0
I have the same problem. I'm using Windows 7. But I have batch files to change the color desktop color to black. It's not the fastest, but it uses .bat files to change the desktop. But here is what I have.

First .bat file
@ECHO OFF
:: Written by Eric Husband
:: 7/10/2009
REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "C:\Users\Public\Pictures\Sample Pictures\Desert.jpg"
REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 2

Second .bat file
@ECHO OFF
:: Written by Eric Husband
REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "C:\Program Files\DVD Maker\Shared\DvdStyles\Vignett\black.png"
REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 2
REG ADD "HKCU\Control Panel\Desktop" /V TileWallpaper /T REG_SZ /F /D 0
:: The following line refreshes the desktop.
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters

Now the strange thing is, you have to run the first .bat file until the picture changes to the actual image that you want (e.g. the desert.jpg). Then you can use the second .bat file and log off. Then once you log off, then it should stay black, instead of going back to the original picture. My does anyway.

But anyway, maybe somebody else can figure out a way to improve it. Hope it helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top