VB SCript

  • Thread starter Thread starter Jarek
  • Start date Start date
J

Jarek

I'm trying to run this script in cmdlines.txt,
while building the system (XP):




strComputer = ""
'create the file system object
set objFso=CreateObject
("Scripting.fileSystemObject")
'create the file object
Set objTextFile = objFso.CreateTextFile
("c:\Infofile.txt", True)

Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf
("Win32_ComputerSystemProduct")

For Each wbemObject In wbemObjectSet
objTextFile.WriteLine("Vendor : " &
wbemObject.Vendor)
objTextFile.WriteLine("Name : " &
wbemObject.Name)
objTextFile.WriteLine("Identifying Number : " &
wbemObject.IdentifyingNumber)
Next





It doesn't work at that point, (fails at the "For" line)
while it doesn't have a problem to run
on the same machine later on,
after it actually reboots and restarts.

Does anyone know why and if there is any
way to force this script to run at the stage,
I'm trying to get it to work?

TIA,

Jarek
 
Back
Top