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

Action - Set Default WallpaperSo 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.

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 thoughts to “Setting the default wallpaper on a Windows 10 image deployment through MDT”

    1. 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. 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

  1. 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
    Access is denied.

    C:\windows\system32>del /q C:\Windows\Web\4K\Wallpaper\Windows\*.*
    Access is denied.
    Access is denied.
    Access is denied.
    Access is denied.
    Access is denied.
    Access is denied.
    Access is denied.
    Access is denied.
    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.

    Press any key to continue . . .

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

  2. 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. 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