I was unable to install software or run scripts after the step “Setup windows and ConfigMgr” in the task sequence. Simply because they do not run anymore due to the SCCM Wyse post-deployment scripts that run after deployment. In this guide I want to add a registry key to the image that depends on a choice (variable) in the task sequence.
Step 1 Prepare the Image for the Task Sequence action we’re going to make.
- Mount the WIM-image with imagex or a great tool called GImageX.
- Add a folder c:\install
- Add the following line to the script “AdminSCCM.bat” in c:\windows\setup\ before the line “if exist “c:\windows\system32\fbwfmgr.exe” c:\windows\system32\fbwfmgr /enable”
CALL "C:\install\run.cmd" wsleep 4
- You may want to increase the wsleep value if your actions fail like installing software.
- Unmount the image and commit changes.
Step 2 Create a task in the Task Sequence.
In this case I only want to add a regkey to the image. When you want to install software you can copy files from a software package to the c:\install folder.
- Create a “Run Command Line” task.
- Add the following command.
cmd /c echo REG ADD "HKLM\SOFTWARE\xxxxxxxx\SCCM" /v ImageVersion /t REG_SZ /d %SMSTSimagever% /f >> c:\install\run.cmd"
That`s it. When you run the deployment the AdminSCCM.bat will start the c:\install\run.cmd in a deployed Microsoft Windows Embedded.