Setting the default wallpaper on a Windows 10 image deployment through MDT

,

So recently I’ve been working on improving and streamlining our imaging process. One of the pain points that I have had with Windows 10 was an easy way of setting the default wallpaper, but without locking out the user, i.e. Group Policy from changing it in the future. After a long session of Google Fu and finding Powershell and VB scripts I settled on a simple solution of a batch file to take ownership and replace the default wallpaper files.

Action - Set Default Wallpaper

As the majority of our devices are laptops, I set the default img0.jpg to a resolution of 1366 x 768 and then proceeded to create all of the different resolutions in the 4K folder, 1024×768, 1200×1920, 1366×768, 1600×2560, 1920×1200, 2160×3840, 2560×1440, 2560×1600, 3840×2160, 768×1024, 768×1366. Once I had all the images ready, I created a file structure and then made the below batch or cmd file for my Application Install Task. If you are running SCCM instead of just MDT, change Administrators to SYSTEM.

takeown /f c:\windows\WEB\wallpaper\Windows\img0.jpg
takeown /f C:\Windows\Web\4K\Wallpaper\Windows\*.*

icacls c:\windows\WEB\wallpaper\Windows\img0.jpg /Grant Administrators:(F)
icacls C:\Windows\Web\4K\Wallpaper\Windows\*.* /Grant Administrators:(F)

del c:\windows\WEB\wallpaper\Windows\img0.jpg
del /q C:\Windows\Web\4K\Wallpaper\Windows\*.*

copy "%~dp0img0.jpg" c:\windows\WEB\wallpaper\Windows\img0.jpg
copy "%~dp04k\*.*" C:\Windows\Web\4K\Wallpaper\Windows

Once I had everything ready, I created an New Application Install called Action – Set Default Wallpaper and got it to call my batch file. Once that was done, I went and added it into my Task Sequence for building our Windows 10 Image as one of the first items to run once Windows 10 has passed the OOBE stage, so under State Restore, after the Windows Updates.

That process has worked every time flawlessly for me, where as the scripts I had found didn’t.


7 responses to “Setting the default wallpaper on a Windows 10 image deployment through MDT”

  1. Philip Berg Avatar
    Philip Berg

    Thanks for your hard work. Worked great for me!

  2. ross Avatar
    ross

    it works until you do a big anniversary update correct?

    1. John Avatar
      John

      Haven’t tried it yet with 1803 – we’re going to begin testing in the next few weeks and see how this goes. Don’t see why this won’t keep working.

      1. Ross Avatar
        Ross

        The script works fine, it’s just after you install 1803 it replaces the wallpaper with the original wallpaper. You’d need to re-run the script

  3. Marek Trebacz Avatar
    Marek Trebacz

    Im fairly new to creating Packages and not sure where i am going wrong. I am using standalone SCCM and win 10 1803.

    When i deploy the ts it fails on this step. I decided to try and run the script on my test machine and i seems to be getting a hole bunch of access denied:

    C:\windows\system32>takeown /f c:\windows\WEB\wallpaper\Windows\img0.jpg

    SUCCESS: The file (or folder): “c:\windows\WEB\wallpaper\Windows\img0.jpg” now owned by user “Domain\User Name”.

    C:\windows\system32>takeown /f C:\Windows\Web\4K\Wallpaper\Windows\*.*

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_1024x768.jpg” now owned by user “Domain\User Name”.

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_1200x1920.jpg” now owned by user “Domain\User Name”.

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_1366x768.jpg” now owned by user “Domain\User Name”.

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_1600x2560.jpg” now owned by user “Domain\User Name”.

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_2160x3840.jpg” now owned by user “Domain\User Name”.

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_2560x1600.jpg” now owned by user “Domain\User Name”.

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_3840x2160.jpg” now owned by user “Domain\User Name”.

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_768x1024.jpg” now owned by user “Domain\User Name”.

    SUCCESS: The file (or folder): “C:\Windows\Web\4K\Wallpaper\Windows\img0_768x1366.jpg” now owned by user “Domain\User Name”.

    C:\windows\system32>icacls c:\windows\WEB\wallpaper\Windows\img0.jpg /Grant Administrator:(F)
    processed file: c:\windows\WEB\wallpaper\Windows\img0.jpg
    Successfully processed 1 files; Failed processing 0 files

    C:\windows\system32>icacls C:\Windows\Web\4K\Wallpaper\Windows\*.* /Grant Administrator:(F)
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_1024x768.jpg
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_1200x1920.jpg
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_1366x768.jpg
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_1600x2560.jpg
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_2160x3840.jpg
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_2560x1600.jpg
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_3840x2160.jpg
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_768x1024.jpg
    processed file: C:\Windows\Web\4K\Wallpaper\Windows\img0_768x1366.jpg
    Successfully processed 9 files; Failed processing 0 files

    C:\windows\system32>del c:\windows\WEB\wallpaper\Windows\img0.jpg
    c:\windows\WEB\wallpaper\Windows\img0.jpg
    Access is denied.

    C:\windows\system32>del /q C:\Windows\Web\4K\Wallpaper\Windows\*.*
    C:\Windows\Web\4K\Wallpaper\Windows\img0_1024x768.jpg
    Access is denied.
    C:\Windows\Web\4K\Wallpaper\Windows\img0_1200x1920.jpg
    Access is denied.
    C:\Windows\Web\4K\Wallpaper\Windows\img0_1366x768.jpg
    Access is denied.
    C:\Windows\Web\4K\Wallpaper\Windows\img0_1600x2560.jpg
    Access is denied.
    C:\Windows\Web\4K\Wallpaper\Windows\img0_2160x3840.jpg
    Access is denied.
    C:\Windows\Web\4K\Wallpaper\Windows\img0_2560x1600.jpg
    Access is denied.
    C:\Windows\Web\4K\Wallpaper\Windows\img0_3840x2160.jpg
    Access is denied.
    C:\Windows\Web\4K\Wallpaper\Windows\img0_768x1024.jpg
    Access is denied.
    C:\Windows\Web\4K\Wallpaper\Windows\img0_768x1366.jpg
    Access is denied.

    C:\windows\system32>copy “\\Servername\Source\Scripts\Windows 10 Customization\WallPaper\img0.jpg” c:\windows\WEB\wallpaper\Windows\img0.jpg
    Access is denied.
    0 file(s) copied.

    C:\windows\system32>copy “\\Servername\Source\Scripts\Windows 10 Customization\WallPaper\4k\*.*” C:\Windows\Web\4K\Wallpaper\Windows
    \\\Source\Scripts\Windows 10 Customization\WallPaper\4k\*.*
    The system cannot find the path specified.
    0 file(s) copied.

    C:\windows\system32>Pause
    Press any key to continue . . .

    Any help would be much appreciated. I’m sure I’m going something silly.

  4. Nick Avatar
    Nick

    I receive the same errors: Access denied no permissions to folder! It is really nobody wan’t help. Where actually is the right folder to place 4k folder on the deployment share and the bat file ?

    1. John Avatar
      John

      Hey Nick, if you’re getting access denied it is usually the copy into the image. Make sure your running it during the State Restore stage with MDT. If you’re doing this without MDT/SCCM then you won’t have permission with any normal user (even an admin).

Leave a Reply

More Posts

Time Hierarchy in Active Directory

Time is more critical in Active Directory than many admins realise. Time inaccuracy can cause logs to mismatch or things like license failures for anything with DRM. Larger time differences can begin to cause authentication failures since Keberos relies on accurate time or affect replication health. By default, all AD member machines synchronise with any […]

Exchange Management with AD Users when using RSAT for Windows 7

One of the little things with the have annoyed me since I’ve started using the RSAT tools in Windows is the fact that there is no easy way to manage Exchange. Sure I can install the Exchange Management Pack and use that, but like most admin’s AD Users and Computers is open just about all […]

Backup MySQL Databases running on a Windows Server using Systems Center Data Protection Manager (DPM) 2012.

Running MySQL on a Windows machine is pretty straight forward.  One of the down sides though is that MySQL is not VSS aware and may mis-behave when back up software such as Data Protection Manager or ShadowProtect.  Data Protection Manager (DPM) has the ability (basically called Pre-Backup and Post-Backup Scripts) to perform actions before and after […]