Trying to run WMI obejct in Windows XPe

G

Guest

I am trying to run a Visual Basic script that will collect the serial number of a HP5700 thin client from the BIOS using WMI obeject call and I am getting an errors. Does Windows XPe support WMI calls

Below is the scrip

----------------------------------------------------------------

strComputer = ".

Set objWMIService = GetObject("winmgmts:"
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
MsgBox "hello
Set colBIOS = objWMIService.ExecQuery
("Select * from Win32_BIOS"
MsgBox "hello1
For Each objBIOS In colBIO
strSerialNumber = objBIOS.SerialNumbe
MsgBox strSerialNumbe
En
Next
 
K

KM

Jodisho,

You haven't mentioned the errors you are getting from running the script. XPein general (as it's based on XP binaries) supports WMI
technologies. However, it depends on what the manufacturer (HP in your case) has included in to the image whether WMI works within
the image or not.
The best way for you would be contacting the manufacturer for more info about the image you got and if WMI is included.
Another way could be exploring what is in the image (use Admin account). This way you can verify if WMI core is there. Also, check
the error you get and the EventView log as well. You may sometimes easy figure out what is missing. How to add it to your image -
next step and different story.

--
KM,
BSquare Corporation
I am trying to run a Visual Basic script that will collect the serial number of a HP5700 thin client from the BIOS using WMI
obeject call and I am getting an errors. Does Windows XPe support WMI calls?
 
S

Sean Gahan

Jodisho,
There is a known issue with XPE and scripting, and there is an easy fix. I
would find it hard to believe that HP would overlook this particular issue,
but you check the registry for the following settings. Additionally, you
can save this a reg file and run it.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command]
@="C:\\WINDOWS\\system32\\WScript.exe %1"

[HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command]
@="C:\\WINDOWS\\system32\\CScript.exe %1"

[HKEY_CLASSES_ROOT\JSEFile\Shell\Open\Command]
@="C:\\WINDOWS\\system32\\WScript.exe %1"

[HKEY_CLASSES_ROOT\JSEFile\Shell\Open2\Command]
@="C:\\WINDOWS\\system32\\CScript.exe %1"

[HKEY_CLASSES_ROOT\JSFile\Shell\Open\Command]
@="C:\\WINDOWS\\system32\\WScript.exe %1"

[HKEY_CLASSES_ROOT\JSFile\Shell\Open2\Command]
@="C:\\WINDOWS\\system32\\CScript.exe %1"

[HKEY_CLASSES_ROOT\VBEFile\Shell\Open\Command]
@="C:\\WINDOWS\\system32\\WScript.exe %1"

[HKEY_CLASSES_ROOT\VBEFile\Shell\Open2\Command]
@="C:\\WINDOWS\\system32\\CScript.exe %1"

[HKEY_CLASSES_ROOT\WSFFile\Shell\Open\Command]
@="C:\\WINDOWS\\system32\\WScript.exe %1"

[HKEY_CLASSES_ROOT\WSFFile\Shell\Open2\Command]
@="C:\\WINDOWS\\system32\\CScript.exe %1"

[HKEY_CLASSES_ROOT\WSHFile\Shell\Open\Command]
@="C:\\WINDOWS\\system32\\WScript.exe %1"

[HKEY_CLASSES_ROOT\WSHFile\Shell\Open\Command]
@="C:\\WINDOWS\\system32\\CScript.exe %1"

Regards,

Sean Gahan




Jodisho said:
I am trying to run a Visual Basic script that will collect the serial
number of a HP5700 thin client from the BIOS using WMI obeject call and I am
getting an errors. Does Windows XPe support WMI calls?
 

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

Top