From: Tom Lavedas on 16 Nov 2007 09:30 On Nov 16, 9:07 am, "Jaz" <jrect...(a)yahoo.com> wrote: > THANKS!!! > > "RemS" <R...(a)discussions.microsoft.com> wrote in message > > news:5A5895CF-CF70-4DD6-A006-B94C10475FDF(a)microsoft.com... > > > "Jaz" wrote: > > > > Does anybody know how I can change a users desktop wallpaper using a > script > > > or batch file? > > > > I would like it to change when they log in. > > > > Any suggestions? > > > > Thanks, > > > Jasper > > > Go to registry key: > > HKEY_CURRENT_USER\Control Panel\Desktop > > there you see that the Windows in fact make a new and converted version of > > the picture to set as desktop wallpaper. > > What you need to to is copy, that registry key, and also copy the > different > > versions of the picture from a sample computer and copy then to exact the > > same location, but now for logged-on user's profile on the client > computer. > > > After the registry is edited and the files are copied, run this command: > > Set oShell=CreateObject("WScript.Shell") > > oShell.Run "RunDLL32.exe user32.dll, UpdatePerUserSystemParameters",0 > ,False > > > What i did once was creating two 'shadow' keys: > > HKEY_CURRENT_USER\Control Panel\Desktop.org > > HKEY_CURRENT_USER\Control Panel\Desktop.def > > > The ...\Desktop.def contains all the entries that you want users to use. > > > A script copied all original entries and subkeys from the ...\Desktop key > to > > the ...\Desktop.org key. And then copies all entries from ...\Desktop.def > key > > to the ...\Desktop key. > > > oShell.Run "Reg.exe copy ""HKCU\Control Panel\Desktop.def"" ""HKCU\Control > > Panel\Desktop"" /f /s",0 ,True > > > Update SystemParameters to load the new wallpaper > > > \Rems I would observe that this approach is OS dependent. I believe it requires Win XP+ to work. When I tested this back in 2004 under Win2K, it didn't work - though it threw no error, which suggests that the entry point into the user32.dll was valid, but for some reason it wasn't working. I'm pretty sure it doesn't work in any of the Win9x variants, either. Also note that all DLL entry points executed via the rundll32 utility are case sensitive. Tom Lavedas =========== http://members.cox.net/tglbatch/wsh/ |