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

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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,
 
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,
 
Back
Top