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

Fixing HTTP Error 500.21 – Internal Server Error Handler “WebServiceHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list on IIS.

I was recently developing some .net web applications at work and finally took the plunge of setting up a server to host them after I was happy that we had reached the point where they were usable applications.  So after setting up Server 2008 R2, I went ahead and enabled IIS with asp.net configuration enabled […]

How to allow an Active Directory Certificate Authority to generate Certificates with a Subject Alternative Name attribute

Starting with Google Chrome 58, Chrome no longer trusts certificates without the Subject Alternative Name attribute, so this makes it a little troublesome for those with internal CAs where you rely on them for Software Development. We noticed last week that some end users couldn’t hit an internal application over HTTPS, but was fine in […]

Fixing SMS Site Component Manager could not access site system. Access is denied. Issue when adding SCCM components to other servers.

I recently decided to move our reporting services running on our SCCM site server to our more beefier SQL Server, I was also wanting to do this for our Forefront Migration (as Reporting services is a requirement). So I created a new server under Site Settings -> Site Systems and put our SQL server into […]