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.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
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.
Share this post
Link to post
Share on other sites