Introduction

Windows Preinstallation Environment (WinPE) is a lightweight version of Windows used for deploying workstations and servers. By adding HTA support, you can run HTML-based applications during the deployment process, providing a flexible way to interact with the deployment environment.

Step-by-Step Guide

Follow these steps to add HTA support to your WinPE images in SCCM 2007:

1. Copy WinPE Files

First, copy the WinPE files from the Windows AIK installation directory to a network location:

copy "C:\Program Files\Windows AIK\Tools\PETools\amd64" "\\serveur\partage\amd64"
copy "C:\Program Files\Windows AIK\Tools\PETools\x86" "\\serveur\partage\x86"

2. Mount WinPE Images and Add HTA Packages

Create a directory for mounting the images:

md c:\mount

Mount the WinPE image and add the HTA packages:

DISM.exe /Mount-Wim /WimFile:"\\serveur\partage\amd64\winpe.wim" /MountDir:c:\mount /index:1
dism /image:c:\mount /Add-Package /packagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\winpe-hta.cab"
dism /image:c:\mount /Add-Package /packagePath:"C:\Program Files\Windows AIK\Tools\PETools\amd64\WinPE_FPs\fr-fr\winpe-hta_fr-fr.cab"
DISM.exe /Unmount-Wim /MountDir:c:\mount /commit

DISM.exe /Mount-Wim /WimFile:"\\serveur\partage\x86\winpe.wim" /MountDir:c:\mount /index:1
dism /image:c:\mount /Add-Package /packagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-hta.cab"
dism /image:c:\mount /Add-Package /packagePath:"C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\fr-fr\winpe-hta_fr-fr.cab"
DISM.exe /Unmount-Wim /MountDir:c:\mount /commit

3. Add the Modified WinPE Images to SCCM

Import the modified WinPE images into SCCM:

  1. Open the SCCM console.
  2. Navigate to Operating System Deployment > Boot Images.
  3. Right-click and select Add Boot Image.
  4. Browse to the location of your modified WinPE image and add it.

4. Modify Task Sequences to Use the New WinPE Images

Edit your task sequences to use the new WinPE images and include HTA scripts:

  1. Open the task sequence in SCCM.
  2. Replace the current boot image with your new WinPE image.
  3. Add a step to run your HTA script during the task sequence.

5. Using HTA Scripts in Task Sequences

In your HTA script, you can set SCCM task sequence variables using VBScript:

Set env = CreateObject("Microsoft.SMS.TSEnvironment")
env("Variablexxx") = document.Selection.Menu.value

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.