VB Script not running on XP embedded! What components required?

G

Guest

Hi All,

I have got a VB script file which is failing to run XP Embedded image.
The script file is for finding USB interface type disk drives, get the drive
letter and rename.

GetObject ("winmgmts:{impersonationLevel=Impersonate}!//" & strComputer)

objWMIService.ExecQuery ("SELECT * FROM Win32_DiskDrive where InterfaceType
= 'USB'")

objWMIService.ExecQuery ("ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & _
strDeviceID & """} WHERE " & "AssocClass =
Win32_DiskDriveToDiskPartition")

objWMIService.ExecQuery ("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _
wmiDiskPartition.DeviceID & """} WHERE " & "AssocClass =
Win32_LogicalDiskToPartition")

ltrim(objFile.ReadLine)

The script file is working on my XP Pro system.

May i know what components are required for this to execute?

Thanks
 
G

Guest

I meant these are the commands which r giving error:

GetObject ("winmgmts:{impersonationLevel=Impersonate}!//" & strComputer)
objWMIService.ExecQuery ("SELECT * FROM Win32_DiskDrive where InterfaceType
= 'USB'")

objWMIService.ExecQuery ("ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & _
strDeviceID & """} WHERE " & "AssocClass =
Win32_DiskDriveToDiskPartition")

objWMIService.ExecQuery ("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _
wmiDiskPartition.DeviceID & """} WHERE " & "AssocClass =
Win32_LogicalDiskToPartition")

ltrim(objFile.ReadLine)

Thanks
 
S

Sean Liming \(eMVP\)

From my XP Embedded Supplemental Toolkit book, do you have the following
components?

Windows Script Engines
WMI Scripting
WMI Core
Terminal Service WMI Provider
Windows Product Activation WMI Provider
WMI Consumers
WMI Correlation
WMI DS Provider
WMI Extensions to WDM Property Page Provider
WMI Extensions to WDM Service
WMI Filter
WMI SNMP Provider
WMI View Provider
WMI Win32 Provider
WMI Windows Installer Provider

Regards,

Sean Liming
www.sjjmicro.com / www.seanliming.com
Book Author - XP Embedded Advanced, XP Embedded Supplemental Toolkit
 
B

Bill

Hi,
Thanks for the info..
Before adding all these components(few of which were already there), i was
getting syntax error on WSH.

Now, after adding it says: provider type not defined

something is still missing

Regards,
 
B

Bill

And also i cant find: Windows Product Activation WMI Provider in my data base

I have XPe SP2 FP 2007

My image is not having this component

Regards,
 

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