Windows Preinstallation Environment

Windows Preinstallation Environment, often shortened to WinPE or Windows PE, is a minimal version of Windows typically used for system deployment or recovery. It is configured in such way that changes made to the environment do not persist across reboots, which makes it possible to boot it from read-only media such as CD-ROM discs or across the network. It has been introduced with Windows XP as a replacement for MS-DOS-based boot disks. Since then, it has been adopted for the setup and the recovery environment starting with Windows Vista.

In Windows XP, the environment is loaded by  in a similar manner to the text mode setup. However, it does not load the operating system into a RAM disk by default and therefore it is required to keep the system disk in the drive, as ejecting it would cause the system to misbehave. In Windows Vista, the system is stored inside a WIM file called, which is loaded by the boot manager into a RAM disk and then executed.

Compared to regular editions, Windows PE uses the  switch to instruct the kernel to load registry hives as volatile, which makes sure that the operating system does not try to save any registry changes to the boot disk.

Usage
Windows PE is used for the following purposes:


 * To install Windows versions starting with Windows Vista. The user configures multiple aspects of the installation, such as what SKU of Windows the user would like to install, where Windows should be installed, and whether the user would like to perform an upgrade or clean installation. The setup is booted via the  file on the installation media. The install process works by deploying a pre-packed WIM image  to the hard disk where Windows should be installed. The image index determines what SKU of Windows will be installed. From Windows 7 onwards, the DISM command line tool is used to deploy the image to the location where Windows is installed. After the WIM image is applied, the installer creates boot files on the hard disk, and restarts the machine so that devices can be set up, and the OOBE can be run.
 * To pre-install Windows on corporate machines, including for servers. It is also used by system builders and OEMs to prepare new machines ready for sale.
 * To recover an existing Windows installation, using tools such as Command Prompt to recover any version of Windows, even if it is offline and cannot be started normally.
 * To create third-party recovery media based on WinPE. Such media often has recovery tools preinstalled, as well as a full desktop and Start menu added.