Winpe 2.0, hta & wmi



I am in the process of creating a hta page which includes a WMI script. It
looks at the machines BIOS to get the correct information of the machine to
assist in the installation.
The WMI scripts being used are basic ones, they are giving error messages
when used in the winpe 2.0 environment. I have tried them in Vista (build
5744) and they work ok, giving back the information I am expecting with no
error messages.
Any ideas why?

Below is the script I am using:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystemProduct",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "Win32_ComputerSystemProduct instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "Name: " & objItem.Name


Just a guess here - probably works OK in Vista because Vista includes Win PE
with the HTA package.. In a "stand alone" environment HTA package must be
installed ion Win PE.


Yes when you create the initial winpe boot environment you have the option to
install extra packages which are: HTA, Scripting Host, XML support.
I have added all these into the boot CD and have checked via the command
peimg /list when I have mounted the wim file with imagex.
I can get a simple hta screen to appear it is only when I begin doing more
complex scripting, as below.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question