Export (0) Print
Expand All

WinPE: Mount and Customize

Updated: December 9, 2013

Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2

Add drivers to Windows PE, such as graphics drivers or network drivers.

Common customizations:

  • Click Start, and type deployment. Right-click Deployment and Imaging Tools Environment and then select Run as administrator.

  • In the Deployment Tools and Imaging Environment, copy the Windows PE files for the PCs you want to boot.

    • The 64-bit version can boot 64-bit UEFI and 64-bit BIOS PCs.

      copype amd64 C:\WinPE_amd64
      
    • The 32-bit version of Windows PE can boot 32-bit UEFI, 32-bit BIOS, and 64-bit BIOS PCs.

      copype x86 C:\WinPE_x86
      

  • Mount the Windows PE image.

    Dism /Mount-Image /ImageFile:"C:\WinPE_amd64\media\sources\boot.wim" /index:1 /MountDir:"C:\WinPE_amd64\mount"
    

  1. Modify the Startnet.cmd script to include your customized commands. This file is located at C:\WinPE_amd64\mount\Windows\System32\Startnet.cmd.

    You can also call other batch files or command line scripts from this file.

    For Plug and Play or networking support, make sure that you include a call to wpeinit in your customized Startnet.cmd script. For more info, see Wpeinit and Startnet.cmd: Using WinPE Startup Scripts.

  1. Create an app directory inside the mounted Windows PE image.

    md "C:\WinPE_amd64\mount\windows\<MyApp>"
    
  2. Copy the necessary app files to the local Windows PE directory.

    Xcopy C:\<MyApp> "C:\WinPE_amd64\mount\windows\<MyApp>"
    
  3. Test the app later by booting Windows PE and running the application from the X: directory.

    X:\Windows\System32> X:\Windows\<MyApp>
    

    If your app requires temporary storage, or if Windows PE becomes unresponsive when it runs an app, you may need to increase the amount of temporary storage (scratch space) allocated to Windows PE.

  4. To automatically launch a shell or application that runs when Windows PE starts, add the path location to the Winpeshl.ini file. For more info, see Winpeshl.ini Reference: Launching an app when WinPE starts.

  1. Windows PE reserves memory on the X: drive to unpack the Windows PE files, plus additional temporary file storage, known as scratch space, that can be used by your applications. By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512:

    Dism /Set-ScratchSpace:128 /Image:"C:\WinPE_amd64\mount"
    

  1. If you've got multiple versions of Windows PE, you can set the background image so you can instantly tell which version of Windows PE is running.

    Change the security permissions of the Windows PE background image file (\windows\system32\winpe.jpg). This allows you to modify or delete the file.

    1. In Windows Explorer, navigate to C:\WinPE_amd64\mount\windows\system32.

    2. Right-click the C:\WinPE_amd64\mount\windows\system32\winpe.jpg file, and select Properties > Security tab > Advanced.

    3. Next to Owner, select Change. Change the owner to Administrators.

    4. Apply the changes, and exit the Properties window to save changes.

    5. Right-click the C:\WinPE_amd64\mount\windows\system32\winpe.jpg file, and select Properties > Security tab > Advanced.

    6. Modify the permissions for Administrators to allow full access.

    7. Apply the changes, and exit the Properties window to save changes.

  2. Replace the winpe.jpg file with your own image file.

  • Some Windows PE settings can be managed by using an answer file, such as firewall, network, and display settings. Create an answer file, name it unattend.xml, and add it to the root of the Windows PE media to process these settings. For more information, see Wpeinit and Startnet.cmd: Using WinPE Startup Scripts.

  1. Unmount the Windows PE image.

    Dism /Unmount-Image /MountDir:"C:\WinPE_amd64\mount" /commit
    
  2. Create bootable media, such as a USB flash drive.

    MakeWinPEMedia /UFD C:\WinPE_amd64 F:
    
  3. Boot the media. Windows PE starts automatically. After the Windows PE window appears, the wpeinit command runs automatically. This may take a few minutes. Verify your customizations.

In some cases, you may not be able to recover the mounted image. DISM protects you from accidentally deleting the working directory, so you may have to try the following steps to get access to delete the mounted directory. Try each of the following steps:

  1. Try remounting the image:

    dism /Remount-Image /MountDir:C:\mount
    
  2. Try unmounting the image, discarding the changes:

    dism /Unmount-Image /MountDir:C:\mount /discard
    
  3. Try cleaning up the resources associated with the mounted image:

    dism /Cleanup-Mountpoints
    

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft