2

When I "image" a computer using a Task Sequence, I want new users to have a default custom desktop image. They should have the option to change it, so I do not want to use Group Policy. I also can't use the user side of a GPO with Loopback, so setting the Windows Theme and/or a login script is not an option.

That said, what I have been doing for the last few years is renaming the normal default desktop image at %systemroot%\Web\Wallpaper\Windows\img0.jpg and then dropping in the custom image with that original name. That has worked well (and continues to work).

Windows feature upgrades have recently started breaking that model. I run the same rename/replace script as part of the upgrade TS, and when it is done, the correct files sit where they should. However, the desktop background for any user is the default, "blue-light window" picture. The settings window will show a mini version of what I expect to see, but the actual desktop is of the default image. This is true for existing profiles and for new profiles. They point to the custom image, but use the Windows image (from some hidden, unknown source).

Clearly, Microsoft is doing something funky, and I can't resolve it. Thus, I figured I have to use a different method of setting a default, custom desktop image.

I am already loading, modifying and unloading the Default\NTUSER.DAT file in order to set some other default options, so I just added an additional line:

REG LOAD HKLM\DefaultUser %SystemDrive%\Users\Default\NTUSER.DAT   
REG ADD "HKLM\DefaultUser\Control Panel\Desktop" /v "Wallpaper" /d "%ProgramData%\MySettings\CustomDesktop.jpg" /t REG_SZ /f   
:: other adjustments   
REG UNLOAD HKLM\DefaultUser   

That works in that after the TS is done, the Default\NTUSER.DAT file does have the correct path to the custom image, however users have the default path, C:\Windows\Web\Wallpaper\Windows\img0.jpg in their HKCU\Control Panel\Desktop Wallpaper registry key. All the other adjustments to the default registry file remain for new profiles, but not that one.

This shouldn't be that hard! And, someone else must be doing this!

What is the "trick"?

Thanks.

Teknowledgist
  • 358
  • 5
  • 16
  • Have you also modified the images contained within *\Windows\Web\4K\Wallpaper\Windows*? – Ramhound Jun 13 '22 at 23:17
  • I rename the `4k` directory. However, I just realized that the renamed directory is still there after the upgrade, so the re-rename can't occur. That could be the problem here regarding the upgrade. – Teknowledgist Jun 14 '22 at 12:49
  • The first thing you should verify, if you manually perform the rename of the folder, does this method work (going to venture to guess it absolutely will work). At that point you have to figure out how to achieve your goal, my suggestion, a delayed scheduled task that uses a PowerShell script. – Ramhound Jun 14 '22 at 13:03
  • I don't think it would need to be delayed, and it should allow me to continue with the old method. However, the default user registry method would be "cleaner" in that it doesn't change any of Microsoft's files. – Teknowledgist Jun 14 '22 at 14:50

1 Answers1

1

I don't know if this is the best solution, but it's what I've been able to get working given that nobody else (especially Microsoft) seems to be interested in configuring default UI adjustments (as opposed to forced UI settings via GPO).

Toward the end of an "imaging" task sequence and also toward the end of an upgrade task sequence, I run a .CMD script that includes:

:: Modify default desktop/lockscreen images (requires taking rights)
%systemroot%\system32\takeown.exe /f %systemroot%\Web\*.* /R
%systemroot%\system32\icacls.exe %systemroot%\Web\*.* /Grant System:(F) /T

:: Remove previously renamed folder (for updates)
RD /S /Q "%systemroot%\Web\4K - renamed"

:: Rename some files to be replaced
Rename %systemroot%\Web\4K "4K - renamed"
Rename %systemroot%\Web\Screen\img100.jpg img200.jpg
Rename %systemroot%\Web\Wallpaper\Windows\img0.jpg img01.jpg

:: Insert my own images
xcopy "%PathToMyCustomLockscreen%" "%systemroot%\Web\Screen\img100.*" /f /y
xcopy "%PathToMyCustomDesktop%" "%systemroot%\Web\Wallpaper\Windows\img0.*" /f /y

The reason it was failing on upgrade was that the renamed 4K folder still existed, so, the new 4k folder would remain and confuse things.

Note this also sets a custom login (and lock) screen, and while users can then choose their own lock screen (and desktop), they cannot set the login screen.

Hope this helps someone.

Teknowledgist
  • 358
  • 5
  • 16