Sunday, July 31, 2016

Customize a boot image that uses Windows PE 4 or Windows PE 10

Customize a boot image that uses Windows PE 4 or Windows PE 10


Use of DISM and WMI to customize an existant Windows PE 10


  1. Copy the boot image (wimpe.wim) from the Windows AIK installation folder (for example, <InstallationPath>Windows AIKToolsPEToolsamd64) to a folder on the computer from which you will customize the boot image. This procedure uses C:WinPEWAIK as the folder name. ( If you have alerady create your own WIM by following this tutorial  you can use them without copying WIM of step 1)
  2. Use DISM to mount the boot image to a local Windows PE folder. For example, type the following command-line:
    dism.exe /mount-wim /wimfile:C:WinPEWAIKwinpe.wim /index:1 /mountdir:C:WinPEMount
    Where C:WinPEWAIK is the folder that contains the boot image and C:WinPEMount is the mounted folder.
    System_CAPS_noteNote
    For more information about DISM, see the Deployment Image Servicing and Management Technical Reference topic in the Windows 7 TechNet Documentation Library.
  3. After you mount the boot image, use DISM to add optional components to the boot image. In Windows PE 3.1, for example, the optional components are located in <InstallationPath>Windows AIKToolsPEToolsamd64WinPE_FPs.
    System_CAPS_noteNote
    This procedure uses the following location for the optional components: C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPs. The path you use might be different depending on the version and installation options you choose for the Windows AIK.
    Type the following to install the optional components:
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPswinpe-wmi.cab"
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPswinpe-scripting.cab" 
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPswinpe-wds-tools.cab"
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPs<locale>winpe-wmi_<locale>.cab"
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPs<locale>winpe-scripting_<locale>.cab"
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPs<locale>winpe-wds-tools_<locale>.cab"
    Where C:WinPEMount is the mounted folder and locale is the locale for the components. For example, for the en-us locale, you would type:
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPsen-uswinpe-wmi_en-us.cab"
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPs en-uswinpe-scripting_en-us.cab"
    dism.exe /image:C:WinPEMount /add-package /packagepath:"C:Program FilesWindows AIKToolsPEToolsamd64WinPE_FPs en-uswinpe-wds-tools_en-us.cab"
    System_CAPS_tipTip
    For more information about the different packages that you can add to the boot image, see the Add a Package to a Windows PE Image topic in the Windows 7 TechNet Documentation Library.
  4. Use DISM to add specific drivers to the boot image, when required. Type the following to add drivers to the boot image, if required:
    dism.exe /image:C:WinPEMount /add-driver /driver:<path to driver .inf file>
    Where C:WinPEMount is the mounted folder.
  5. Type the following to unmount the boot image file and commit the changes.
    dism.exe /unmount-wim /mountdir:C:WinPEMount /commit
    Where C:WinPEMount is the mounted folder.
  6. Add the updated boot image to Configuration Manager to make it available to use in your task sequences. Use the following steps to import the updated boot image:
    1. In the Configuration Manager console, click Software Library.
    2. In the Software Library workspace, expand Operating Systems, and then click Boot Images.
    3. On the Home tab, in the Create group, click Add Boot Image to start the Add Boot Image Wizard.
    4. On the Data Source page, specify the following options, and then click Next.
      • In the Path box, specify the path to the updated boot image file. The specified path must be a valid network path in the UNC format. For example: <servername><WinPEWAIK share>winpe.wim.
      • Select the boot image from the Boot Image drop-down list. If the WIM file contains multiple boot images, each image is listed.
    5. On the General page, specify the following options, and then click Next.
      • In the Name box, specify a unique name for the boot image.
      • In the Version box, specify a version number for the boot image.
      • In the Comment box, specify a brief description of how the boot image is used.
    6. Complete the wizard.
  7. You can enable a command shell in the boot image to debug and troubleshoot it in Windows PE. Use the following steps to enable the command shell.
    1. In the Configuration Manager console, click Software Library.
    2. In the Software Library workspace, expand Operating Systems, and then click Boot Images.
    3. Find the new boot image in the list and identify the package ID for the image. You can find the package ID in the Image ID column for the boot image.
    4. From a command prompt, type wbemtest to open the Windows Management Instrumentation Tester.
    5. Type <SMS Provider Computer> ootsmssite_<sitecode> in Namespace, and then click Connect.
    6. Click Open Instance, type sms_bootimagepackage.packageID="<packageID>", and then click OK. For packageID, enter the value that you identified in step 3.
    7. Click Refresh Object, and then click EnableLabShell in the Properties pane.
    8. Click Edit Property, change the value to TRUE, and click Save Property.
    9. Click Save Object, and then exit the Windows Management Instrumentation Tester.
  8. You must distribute the boot image to distribution points, distribution point groups, or to collections that are associated with distribution point groups before you can use the boot image in a task sequence. Use the following steps to distribute the boot image.
    1. In the Configuration Manager console, click Software Library.
    2. In the Software Library workspace, expand Operating Systems, and then click Boot Images.
    3. Click the boot image identified in step 3.
    4. On the Home tab, in the Deployment group, click Update Distribution Points.

Available link for download