How can I create a custom Microsoft Windows Preinstallation Environment (WinPE) 2004 installation that includes integrated Windows Management Instrumentation (WMI), Windows Script Host (WSH), and ADO?

John Savill

March 16, 2005

3 Min Read
ITPro Today logo

A. The default WinPE 2004 installation doesn't support WMI, WSH, or ADO. To create a WinPE 2004 instance with these components, perform the following procedure. In this example, the base WinPE 2004 CD-ROM has been copied to a F:temppe2004 folder.

  1. Use a command line to change to the folder that contains the WinPE CD-ROM (e.g., F:temppe2004winpe).

  2. Run the mkimg.cmd command, specifying the path for a Windows XP Service Pack 2 (SP2) installation (e.g., D: for the CD-ROM), the target folder to create, and the /wmi parameter, as this example shows:

    mkimg.cmd y: f:temppe2004wmi.tmp /wmi
  3. Run the buildoptionalcomponents.vbs command to create a structure that has the additional files needed for the WMI, WSH, and ADO components.

    Buildoptionalcomponents.vbs /ado /hta /wsh /s:y: /d:f:temppeoptcomp 
  4. Copy the content from the new component folder (F:temppeoptcomp) to your temporary WinPE build location (F:temppe2004wmi.tmp). You can combine steps 3 and 4 if in step 3 you specify /d as the temporary WinPE build location. Then you don't need to manually copy the files.

  5. If you want to connect to a Microsoft SQL Server database, you need to copy two additional .dll files to the temporary WinPE build location. (You can find these files on any XP installation.) Assuming your temporary WinPE build location is f:temppe2004wmi.tmp, copy the files to the following locations:

    F:temppe2004wmi.tmpprogram filescommon filessystemole dbsqloledb.rllF:temppe2004wmi.tmpI386system32dbnmpntw.dll 
  6. Edit startnet.bat in the system32 folder of the temporary WinPE folder by adding an oc.bat line to the end file, as this sample startnet.bat file shows:

factory -winpe@echo offecho.echo.echo.echo.echo IMPORTANT-READ CAREFULLY: The Microsoft Windows Pre-Installation Environmentecho (the "Software") is protected by copyright laws and international copyright echo treaties, as well as other intellectual property laws and treaties. The echo Software is licensed, not sold. In order to install and use the Software, youecho must have executed with Microsoft an appropriate license agreement ("License echo Agreement") for the Software. IF YOU HAVE NOT SIGNED A LICENSE AGREEMENT, echo YOU ARE NOT LICENSED TO INSTALL AND USE THE SOFTWARE. YOU MUST NOTecho INSTALL, COPY, echo OR USE THE SOFTWARE UNTIL A LICENSE AGREEMENT IS EXECUTED.echo.echo.echo You are permitted to remove this paragraph from the startnet.cmd, provided thatecho you acknowledge and agree to the foregoing statements. echo.echo.echo.echo.oc.bat 

You now have a flat-file WinPE instance that contains integrated WMI, WSH, and ADO components. You can use the WBEMTest utility to view WMI support in an installation (use the "Wnum Classes..." option with the cimv2 namespace) when you boot into this WinPE instance.

If you'll use WinPE with Microsoft Systems Management Server (SMS) OS Deployment Feature Pack, you need to copy the winbom.ini file, which by default is at the root of the WinPE temporary folder, to the i386system32 folder of your WinPE installation and add the "Quiet=Yes" line to the [WinPE] section of the file, as this example shows:

[Factory]WinBOMType=WinPEReseal=No[WinPE]Restart=NoQuiet=Yes[PnPDriverUpdate][PnPDrivers][NetCards][UpdateInis][FactoryRunOnce][Branding][AppPreInstall]

If you fail to update and copy the winbom.ini file when you boot to the custom WinPE installation, you'll be prompted during the installation for how you want to shut down the WinPE environment.

If you decide to integrate this WinPE installation into a Microsoft Remote Installation Services (RIS)-based environment, you need to ensure that the account that RIS uses doesn't have write access to the remote installation share because the first machine to boot will build its WMI repository and write it back to the RIS source, potentially rendering it unusable for other machines.

Read more about:

Microsoft

About the Author(s)

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like