Forum Discussion
SjoerdVW
Nov 07, 2019Copper Contributor
Desktop Background Image by script
We have an startup script running picks a random image from a pool and places it in %programfiles%\mycompany\dekstop.jpg
During logon we change the users desktop, poiting to this image.
However: The user doesnt see this image, but an other one.
The strange thing is: when the user wants to change the desktop image, in the preview window the correct image is shown.
Also, running "RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1" will fix the desktop imidiatly.
I added this in the login script, but that doesn't seems to have any effect.
2 Replies
Sort By
- UlisesinIron Contributor
The script might be changing the desktop background, but Windows hasn't finished applying the change when you run the update command. Try adding a short delay (like a few seconds) before running the update command to give Windows time to apply the new setting.
- vihargadhesariyaIron Contributor
Run the image‐set in a User Logon script, not a Computer Startup script
Set HKCU\Control Panel\Desktop\Wallpaper to "%ProgramFiles%\mycompany\desktop.jpg"
Call:
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1,True
If Logon scripts still fire too early, place the above call in
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOr deploy via GPO:
User Configuration → Administrative Templates → Desktop → Desktop Wallpaper