Preventing OEM builds from Accidentally Performing Mini-Setup without the Task Sequence

When you pre-load an OEM build on machines, they are usually set-up to perform Mini-setup as soon as they come up. Customers sometimes have difficulties ensuring that these machines boot to WinPE using boot media or PXE rather than simply performing Mini-setup using input from the user. Usually, if this happens, you have to re-sysprep the machine in order to run the task sequence correctly.

This is a little trick you can run at the end of the OEM pre-load task sequence or ask your vendor to perform in order to prevent the machine from accidentally booting to Mini-Setup. Please note, this trick uses the BCD store and thus only works on Windows Vista and Windows 7.

1. Ask your OEM to run the following command at the end of their build process.

bcdedit /set {default} path "This is an OEM Build. Please reboot using your boot media or network connection to continue."

2. Using your deploy task sequence, add the following command line action to your state restore phase.

bcdedit /set {default} path \Windows\System32\winload.exe

If your user accidentally tries to boot the machine, they will get the following message:


This post was contributed by Aly Shivji a consultant with Microsoft Services - U.S. East Region.

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use.

Comments (3)

  1. DeploymentGuys says:

    ImageX does not capture the BCD store in order to ensure that the image can be deployed to any partition scenario. In fact, MDT uses windows setup to apply the image, not imagex, in order to ensure the BCD store is configured correctly.

    The best ways I have seen this done is through process. I understand your hestitation around vendors not having the skillset to run your fix. The best option is to provide your vendors with an automated process (could be a task sequence or maybe even just a batch file that runs imagex and then your fix). The simplest automation allows all your vendors to apply the same process and ensure that you achieve the standard you seek.

    – Aly Shivji

  2. ScriptingIT says:

    There is a fair amount of comment on this one about.  We sysprep the machine, reboot to PE, set the machine to boot from a local PE image then imagex it for our vendor build.

    This is all broken in 7 as shown here (same thing it seems) and really there is no sensible solution.

    I really hope the various vendors can run our fix (much the same as the posted on only slightly more involved as that one does not work for us).

    Still we deal with a few vendors and I don’t have faith in several of them to understand let alone do this.

    Any chance we get a fix so you can capture an image set to boot to local PE and not have ImageX kill the boot loader?  Anyone know of any plans to fix it?

  3. Nalin says:

    HI Ali,

    Thanks for this. While not strictly on this topic, do you have any guidelines on using bcdedit in a task sequence ?

    I work in a school and some children are smart. if the previous shutdown was not clean on the next startup windows offers three options. this is a back door entry to get at the machine and change local admin password.

    To stop this we have figured out a bcdedit script. We are unable to run this script as part of a task sequence for some reason and we have to run the script as an administrator. Any ideas ?

    Thanks in advance for any ideas in this connection.

Skip to main content