+ Post New Thread
Results 1 to 11 of 11
Windows Thread, Force Registry Refresh in Technical; 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 ...
  1. #1
    michaelf's Avatar
    Join Date
    Jun 2007
    Location
    Kettering, Northants
    Posts
    81
    Thank Post
    7
    Thanked 13 Times in 10 Posts
    Rep Power
    17

    Force Registry Refresh

    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.

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,807
    Thank Post
    3,320
    Thanked 1,056 Times in 977 Posts
    Rep Power
    365
    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

  3. #3

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    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.

  4. #4

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,807
    Thank Post
    3,320
    Thanked 1,056 Times in 977 Posts
    Rep Power
    365
    Quote Originally Posted by Michael View Post
    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

  5. #5
    michaelf's Avatar
    Join Date
    Jun 2007
    Location
    Kettering, Northants
    Posts
    81
    Thank Post
    7
    Thanked 13 Times in 10 Posts
    Rep Power
    17
    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.

  6. #6

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,262
    Thank Post
    242
    Thanked 1,572 Times in 1,252 Posts
    Rep Power
    340
    I set the background for Windows logon using the following line at the end of a logon script:

    Code:
    REM * Sets Background desktop *
    %SYSTEMROOT%\bginfo.exe /i"\\SERVERNAME\netlogon\tools\bginfo\logoff.bgi" /timer:0

  7. Thanks to Michael from:

    michaelf (16th July 2009)

  8. #7
    michaelf's Avatar
    Join Date
    Jun 2007
    Location
    Kettering, Northants
    Posts
    81
    Thank Post
    7
    Thanked 13 Times in 10 Posts
    Rep Power
    17
    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\<username>\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.

  9. #8

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,627
    Thank Post
    920
    Thanked 1,336 Times in 816 Posts
    Blog Entries
    1
    Rep Power
    448
    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)

  10. Thanks to ZeroHour from:

    mac_shinobi (11th January 2010)

  11. #9

    Join Date
    Jan 2009
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi ZeroHour,

    Is your refreshdesktop.exe application available for download?

    Thanks,

    Dean

  12. #10

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,627
    Thank Post
    920
    Thanked 1,336 Times in 816 Posts
    Blog Entries
    1
    Rep Power
    448
    Quote Originally Posted by deanw83 View Post
    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.

  13. #11

    Join Date
    Jan 2009
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    That would be great, thanks very much!

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 8
    Last Post: 8th May 2014, 08:25 AM
  2. IE Auto Refresh Add-on/software
    By EduTech in forum How do you do....it?
    Replies: 8
    Last Post: 1st March 2009, 09:59 PM
  3. Desktop Shorcuts need refresh
    By titch in forum Windows
    Replies: 4
    Last Post: 20th November 2008, 08:19 AM
  4. Group Policy Refresh Intervals.
    By boomam in forum Windows
    Replies: 12
    Last Post: 7th January 2008, 10:52 AM
  5. DHCP Refresh
    By Grommit in forum Windows
    Replies: 5
    Last Post: 4th December 2006, 10:55 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •