Windows PE has actually been approximately for rather a while. (I’ll avoid obtaining into the background here, but I may revisit that v a future post.) yet the instructions for producing a home windows PE picture of her own have actually been pretty lot stuck in time: simplistic batch files. Still, most world never worried around the process, or complained around the instructions, due to the fact that they never developed a boot image on your own; they permit a device (e.g. MDT, SCCM, etc.) execute it because that them.

You are watching: Which script is used to create the windows pe build?

But it is a ability worth having, if nothing else so that you understand the process. Let’s walk v the steps, using something a little more contemporary than a batch file: PowerShell. The easiest means to do that is to analysis a script in chunks; I’ll affix the complete script in ~ the bottom of this post.

First, you need to install the Assessment and Deployment Kit, and also then the home windows PE add-on, as defined in the docs. (The windows PE add-on is something fairly new. Windows PE was split out mainly so that it would be easier to update through fixes, different from the remainder of the ADK kit tools. That said, there’s tho a resistance to doing the — commonly you are stuck waiting for a brand-new release, with community-published workarounds until then.) The current version that the ADK is still 2004 (not 20H2), and it’s quite feasible that variation will remain present for a while.

So how do friend start? Simple, you require to uncover the right papers from the ADK. Hard-coding is bad, for this reason let’s look increase the location from the registry.

*

Next, we want to develop images for the required platforms. There are three to choose from:

*

The “amd64” one is most likely what you need (for both Intel and also AMD-based 64-bit windows installations), yet if you’re tho using tradition boot (not UEFI) and deploying x86 images, you can still create a 32-bit one as well. You can not have realized the there to be an ARM64 option, however there is. Analysis through the What’s new in windows PE documentation, friend might notice that it says the ARM64 platform was added in the windows 8.1 timeframe, which I expect is technically true — if you to be an OEM producing Windows RT devices; they can get one ARM64 add-on. So as soon as did the become available to everyone? with the ADK relax for home windows 10 1809, which developed the home windows PE add-on, the ARM64 photos were included into the bundle in addition to x86 and AMD64.

For each platform that you select, the same steps are then required. Very first you must make a copy that the winpe.wim indigenous the ADK and also mount it:

*

After it’s mounted, you have the right to then do your essential modifications. The very first modification is to include some advantageous optional components. I decided a couple of common ones:

winpe-hta: develop hypertext applications (HTAs) making use of the ie engine, valuable for displaying an easy UIs (e.g. Prefer those presented by MDT)winpe-scripting: This add to the windows Scripting organize engine, through VBScript and JScript scripting languages.winpe-wmi: Windows administration Instrumentation is used for acquiring information about the hardware home windows PE is to run on.winpe-securestartup: offered to carry out BitLocker pre-provisioning in home windows PE.
*

You can discover a full list the the easily accessible components in the documentation. Make sure that friend install any kind of mentioned dependencies, and the corresponding language resources for every one (like I carry out above, adding the “en-us” resources). For example, you could want to add the .NET structure (winpe-netfx) and PowerShell (winpe-powershell).

But don’t gain your really hopes up on few of the provided items. Because that example, you’ll watch a “winpe-wifi-package” in the list, but you won’t uncover this in the ADK. Instead, it’s a component that’s preinstalled in the windows RE photo (winre.wim) the is set up with home windows 10; it’s no something you have the right to use yourself (at least not in any supported way). That’s to be the best disappointment all at once with windows PE, as you view in the What’s new document: There yes, really hasn’t to be any far-ranging enhancements come it since Windows 8.1.

But earlier to producing an image. In enhancement to optional components, you can want to also include drivers. That’s pretty simple:

*

Don’t get lugged away though. You only want to add any wired networking or massive storage chauffeurs that aren’t already supported in home windows PE.

Next, you might want to inject the latest cumulative update:

*

But ns would avoid doing that unless you need to — if you perform that, the will significantly increase the dimension of the boots image, unless you include two added steps that i don’t include in my script: you would should run a DISM command to clean increase the image, then again after ~ unmounting the WIM to export it into a brand-new WIM (freeing up room taken increase by papers that room no much longer used).

Most world want to perform one other “vanity adjustment”: an altering the desktop computer background image from the default. The easiest way to do that is come overwrite the “winpe.jpg” record in the default home windows PE image. That takes a tiny manipulation to obtain past the defense on the file:

*

All that’s left is to include any kind of scripts or regulates that you want to run as soon as Windows PE boots. There space plenty of ways to execute that, as I stated in my previous home windows PE startup blog post. Therefore customize as required. Here’s what I typically do:

*

The an initial line adds a “winpeshl.ini” file, which has two lines:

%SYSTEMROOT%System32wpeinit.exe

When WPEINIT.EXE runs, the will process an unattend.xml file, for this reason you have actually to add that too. It’s additionally not too complex:

http://schemas.microsoft.com/WMIConfig/2002/State”> 32 1024 60 768 Bootstrap 1 wscript.exe X:Bootstrap.vbs

All friend really need is a command to run, i beg your pardon in this case is “wscript.exe X:Bootstrap.vbs”. Therefore the next line add to that script (which deserve to do every little thing you want, using wscript.exe so that it doesn’t present a command home window on the screen).

The last heat replaces the elevator bitmap. (Technically, over there is one extr line after ~ that, which could be uncommented to add a customized startnet.cmd file. See the windows PE startup blog for much more info top top that.)

Then every you have to do is unmount the WIM, committing the changes.

See more: How Many Gallons Does The Average Car Hold S? How Much Does It Cost You To Fill Up

*

So now you can run v the totality script and also everything have to work there is no errors. Other than it doesn’t. If you run it specifically as-is, you’ll see some errors generated by the script, while the is to run the ARM64 steps:

*

So what reasons that? Well, if they added an ARM64 boot photo to the home windows PE add-on package, lock didn’t develop an ARM64 version of “winpe-hta.” So together a result, there’s no means to use HTAs on an ARM64 boots image. But if you want to execute a basic ARM64 depoyment (perhaps making use of something like Johan’s article here), friend can certainly do that.

While this does generate the boot photos that friend need, the doesn’t covering one extr step, i beg your pardon I’ll leave for an additional blog: You require to be able to place these boot pictures into ISOs or onto USB media to in reality boot a device. (If you want to execute PXE, you don’t need any type of extra steps, beyond including them to your WDS or various other PXE server.)