Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've set up a Windows Preinstallation Environment on a USB Thumb Drive (version from the latest iteration of the Windows Automated Install Kit/WAIK), and I'm working on getting a deployment environment set up.

However, we'd like to make it so our Level 1 technicians can use the deployment system, and because of this, I've written several batch files to minimize the amount of command line work the technicians have to do.

Is there a way I can get these scripts to autorun after the PE environment has finished initializing?

share|improve this question
up vote 4 down vote accepted

Under the "sources" folder on the PE key is the "boot.wim" file.

Mount Boot WIM:
dism /Mount-Wim /wimfile:C:[WPE PATH]\sources\boot.wim /index:1 /MountDir:C:\Mounted_images\boot

Then the file can be found at:

Commit changes and Unmount WIM:
dism /Unmount-Wim /MountDir:C:\Mounted_images\boot /commit

If you want to discard changes instead:
dism /Unmount-Wim /MountDir:C:\Mounted_images\boot /discard

share|improve this answer

Generally I don't do autorun scripts for fear that someone would accidentally wipe their machine. The solution I found worked well was to provide a single batch file with a simple name, and tell them to type that at the command-prompt and press return. If you have multiple images for different makes/models you could call it a name based on the made model, e.g. type "dellgx280" to re-image a Dell GX280.

You can however modify the startnet.cmd file (WinPE's equivalent of autoexec.bat) to do it if you really want. That just a case of mounting the PE image r/w, locating the file (at %systemroot%\system32), editing it, then commiting and unmounting.

share|improve this answer
This doesn't mess with the disks, it just sets up the network configuration and launches the installer. Preferably the partitioning will be taken care of manually for both the reason you describe and differentiating systems. – tearman Nov 17 '09 at 18:45

Use the Windows Automated Installation Kit to create a custom WinPE image with a Winpeshl.ini answer file (see

share|improve this answer

I am having a terrible time finding the startnet.cmd file in %systemroot%\system32. I have searched it and looks like it doesn't exist. Does anybody have any suggestions? ~ALM

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.