Updating OSD boot image wim files to include scripts


I'm running SCCM 2012 R2 and have an existing 64-bit boot image that I'm using for Windows 7.  I'd like to add a script to my Boot Image Wim files so that I can run a script directly from the boot image in WinPE.

I found a guide showing how to take the Wim, mount it, add the files, unmount it, and the import it back into SCCM which I'm sure would work. Guide I was using: https://sccmdiet.wordpress.com/2014/03/17/227/

My question is can I do this on a boot image already added to SCCM 2012 R2?  When I go to look at the boot wim, I see two files: 1) The boot wim itself, and another boot wim with the boot wim name plus it's package name from SCCM.


1. Boot.wim

2. Boot.DTM004BB.wim

These are obviously both for the same boot image, and it appears the original boot.wim never gets updated when I add drivers, etc, to it from the SCCM console but the one with the package name does.

So I want to continue using the existing boot image in SCCM and add the script files to the boot image without having to re-import it to SCCM.  I assume I'll need to update one of the boot wim files and then redistribute the content but I'm not sure which one I need to update or if I need to update both, or maybe this can't be done without re-importing?  If it can't be done without reimporting is there a way to get the driver list from the existing boot image to know exactly which inf file it's using?


May 28th, 2015 1:59pm

Guide I was using: https://sccmdiet.wordpress.com/2014/03/17/227/

Way too complicated. Use https://technet.microsoft.com/en-us/library/jj651034.aspx instead.
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 4:09pm

Update boot.wim only. The other (with the package ID in the name) is created by ConfigMgr from boot.wim (or whatever filename is explicitly listed in the data source tab of the properties of the boot image) every time the boot image is updated and sent to your DPs. Thus the one with the package ID in it is effectively a volatile file and any changes you make to it will be thrown away and overwritten by ConfigMgr the next time it updates the boot image (for any reason).
May 28th, 2015 4:09pm

Torsten & Jason, thank you very much for the responses.

Turns out all I needed to do for my situation was to update the main boot.wim with the HTA file I wanted to call at the beginning of my Task Sequence and then re-destribute, re-create my boot stick, and then use a command line job to run mshta.exe x:\myhta.hta in my TS.  This is working perfectly as the 2nd step in my Task Sequence to pick some options for setting task sequence variables.

The pre-start and the method in that guide I posted didn't exactly meet my needs because I only want the HTA to pop up AFTER selecting the task sequence, not immediately after getting into WinPE.

Also, the reason I had to add it to the boot image instead of just simply using a package to run the HTA is that if the partitions on the hard disk didn't exist it would fail to copy the package down and run the HTA as the 2nd step in the TS before i partition the hard drives.  I wanted the HTA to run before the disk part happens though so I didn't have to make the users wait around.

The good news is that I don't have to re-import my boot image when I want to add script files to it, I can just mount the boot.wim, update the files, unmount to save, then redistribute content and it works fine.

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 5:25pm

If you want to be able to run a package before having a writeable disk you can run the TS directly from the DP instead. 

Even if it's not designed for it you should be able to use the prestart function anyway. Simply make a script that does nothing and use the built in coppy function to update your boot images in an easy way

  • Edited by mats42 53 minutes ago
May 29th, 2015 2:40am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics