michaelf Posted July 15, 2009 Posted July 15, 2009 Does anyone know of a way to force windows to re-read the values in the registry, specifically HKEY_CURRENT_USER\Control Panel\Colors and HKEY_USERS\.DEFAULT\Control Panel\Colors? I have written login and startup scripts to update the desktop background colour (at the login screen and on user's desktops) on all our machines but these changes do not seem to take effect until after a reboot or logoff/logon. Normally this wouldn't be a problem but since a lot of our machines use HDGUARD they do not get the new colours at first boot. It also means that users do not get the new colour at first login. I have tried using the RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True command but this will only update the wallpaper, not the background colour. Any thoughts would be much appreciated as would ideas for alternative methods to change the colour that will take effect immediately.
mac_shinobi Posted July 15, 2009 Posted July 15, 2009 38. Activate registry changes in HKEY_CURRENT_USER without logging off (Windows 2000 and later): RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True Credits: Pete Smith. Batch files - RUNDLL and RUNDLL32 http://www.robvanderwoude.com/rundll.php
Michael Posted July 15, 2009 Posted July 15, 2009 If you want to set backgrounds specific colours for specific users (including the logon screen), use BGInfo. If you want examples of logon scripts let me know.
mac_shinobi Posted July 15, 2009 Posted July 15, 2009 If you want to set backgrounds specific colours for specific users (including the logon screen), use BGInfo. If you want examples of logon scripts let me know. Did not read the whole post as tmi so just posted back with the above which will co-incidentally only refresh the user hive of the registry
michaelf Posted July 15, 2009 Author Posted July 15, 2009 Many thanks for both of your suggestions. I'm already using BGINFO as part of the login script to display the IP address and hostname on the desktop once users are logged in, however I haven't thought to try it in a startup script to change the background at login. I'll give that a try tomorrow and let you know how I get on. However, as for the login script, I want to be able to keep the user's own wallpaper (so they can still have that stunning picture of their dog/child/whatever else) while still specifying a solid background colour to be used behind the text (marketing won't let us use our logo with the default blue colour) but unfortunately these two options seem to be mutually exclusive. My thoughts with this was to change the colour as part of the login script, however it appears that this is set too late for BGinfo to pick it up at logon and it instead waits until the 2nd login to do so.
Michael Posted July 15, 2009 Posted July 15, 2009 I set the background for Windows logon using the following line at the end of a logon script: REM * Sets Background desktop * %SYSTEMROOT%\bginfo.exe /i"\\SERVERNAME\netlogon\tools\bginfo\logoff.bgi" /timer:0 1
michaelf Posted July 16, 2009 Author Posted July 16, 2009 I've tried today using BGInfo in a startup script to set the login screen wallpaper and this works perfectly to set both the wallpaper and the desktop background colour. Many thanks for the suggestion. As for the info on the desktop I read somewhere that the wallpaper was stored at "C:\Documents and Settings\\Local Settings\Application Data\Microsoft". I tried pointing BGInfo to this location in an attempt to replicate the built in functionality to use the same wallpaper while still being able to forca a specific background colour. Unfortunately however, this only worked intermittently and refused to work at all at first login (i.e. before the user had manually set a wallpaper). In the end I've given up and decided that having the logo on the login screen and screensaver is enough and that we can do without it on everyone's desktop so I've reverted to using a simple BGInfo file with no logo in. Many thanks for your help on this one, its so easy to get caught up in a problem and sometimes a second pair of eyes (or several thousand pairs) can make a world of difference.
ZeroHour Posted January 11, 2010 Posted January 11, 2010 Sorry to bring a vampire thread to life but I have just coded a very small exe (10kb) to fix this issue. It takes /path /style as switches and if nothing is *switched* all it does is refresh the desktop (aka reload the registry for wallpaper like a log off) This is working under windows 7 and should be fine in XP as well. I have made a project on edugeek and I will be dropping it there if anyone is interested. Basically the exe is refreshdesktop.exe /path {unc to something.bmp.jpg} /style {stretch} and it sets the registry keys and style or if you have no switches it simply reloads the desktop (which re-reads the registry path) 1
deanw83 Posted November 9, 2010 Posted November 9, 2010 Hi ZeroHour, Is your refreshdesktop.exe application available for download? Thanks, Dean
ZeroHour Posted November 9, 2010 Posted November 9, 2010 Hi ZeroHour, Is your refreshdesktop.exe application available for download? Thanks, Dean I have it uploaded on the edugeek server somewhere, will locate. We are running it live here since august with no major issues really. I will dig out the url later tonight, I even have a project page for it that is not live yet.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now