Canada Jack Posted May 25, 2011 Report post Posted May 25, 2011 I just want set up an image as background. So create one package that includes one vb script and one jpg files. I put this in the last step in TS. After the SCCM process was complete, but the background didnt change. I check c drive, the jpg is copy to correct location, but nothing change in registry. When I test this script by manually, its works. Its seem once SCCM is complete, it did some cleanup process. This is my script. Option Explicit '******************************************* Declarations Dim wshShell,wshNetwork,fileSys,objRegistry,oProcEnv,oSystem,oBios,objServ,oHardware Set wshShell = WScript.CreateObject("WScript.Shell") Set wshNetwork = CreateObject("WScript.Network") Set fileSys = CreateObject("Scripting.FileSystemObject") 'Set the error count to 0 nErrorcount = 0 WshShell.Run "reg load ""HKU\Default User"" ""c:\Users\Default\ntuser.dat""",2,True 'Change Desktop Wallpaper fileSys.CopyFile currentdir & "att.JPG", "c:\windows\web\wallpaper\" WshShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper","c:\windows\web\wallpaper\att.JPG","REG_SZ" WshShell.RegWrite "HKEY_USERS\Default User\Control Panel\Desktop\Wallpaper","C:\WINDOWS\web\wallpaper\att.JPG","REG_SZ" WshShell.RegWrite "HKEY_USERS\.Default\Control Panel\Desktop\Wallpaper","C:\WINDOWS\web\wallpaper\att.JPG","REG_SZ" WshShell.RegWrite "HKCU\Control Panel\Desktop\WallpaperStyle","0","REG_SZ" WshShell.RegWrite "HKEY_USERS\Default User\Control Panel\Desktop\WallpaperStyle","0","REG_SZ" WshShell.RegWrite "HKEY_USERS\.Default\Control Panel\Desktop\WallpaperStyle","0","REG_SZ" WshShell.Run "reg unload ""HKU\Default User""",2,True Wscript.Quit nErrorCount Please give some idea, thanks. Quote Share this post Link to post Share on other sites More sharing options...
Eswar Koneti Posted May 26, 2011 Report post Posted May 26, 2011 I use the below script to set the desktop wallpaper: 'Below is the script to change your desktop wallpaper. You just need to modify the script to point to the location where the 'wallpaper is located. 'You can then include this script in your Domain's Group Policy's login or startup script. '----------------------------------------- dim wshShell dim sUserName Set wshShell = WScript.CreateObject("WScript.Shell") sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%") Set oShell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") sWinDir = oFSO.GetSpecialFolder(0) sWallPaper = "C:\Users\ESKONR\Pictures\100_4260.jpg" ' update in registry oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper ' let the system know about the change oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True 'msgbox "done" Quote Share this post Link to post Share on other sites More sharing options...
Canada Jack Posted May 26, 2011 Report post Posted May 26, 2011 I use the below script to set the desktop wallpaper: 'Below is the script to change your desktop wallpaper. You just need to modify the script to point to the location where the 'wallpaper is located. 'You can then include this script in your Domain's Group Policy's login or startup script. '----------------------------------------- dim wshShell dim sUserName Set wshShell = WScript.CreateObject("WScript.Shell") sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%") Set oShell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") sWinDir = oFSO.GetSpecialFolder(0) sWallPaper = "C:\Users\ESKONR\Pictures\100_4260.jpg" ' update in registry oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper ' let the system know about the change oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True 'msgbox "done" Thanks Eswar, but I put your script in TS, still doesn't works. I mean, put this script in Domain's Group Policy's login or startup script, it will works. But I just want figure out why the registry setting doesn't works. Quote Share this post Link to post Share on other sites More sharing options...
Canada Jack Posted May 26, 2011 Report post Posted May 26, 2011 Now I found the issue is: The script only works for current user. But if I create a new user, it will not works. In other words, it doesn't apply for deftalut user. Why? Quote Share this post Link to post Share on other sites More sharing options...
DizzleSizzle Posted May 26, 2011 Report post Posted May 26, 2011 just set a theme via GPO Quote Share this post Link to post Share on other sites More sharing options...
Felipe Binotto Posted July 12, 2012 Report post Posted July 12, 2012 http://fbinotto.blogspot.co.nz/2012/07/sccm-deployment-background-themes-and.html Quote Share this post Link to post Share on other sites More sharing options...