My PC has but the one CPU.
Yet this bit of code produces its output twice (implying there are two CPUs or that the single CPU is multi-threaded - which it's not):
A similar block of code produced similar results at my previous place of employment which used different PCs/CPUs.
Can anyone tell me why I get double output?
JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
Yet this bit of code produces its output twice (implying there are two CPUs or that the single CPU is multi-threaded - which it's not):
Code:
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
' WScript.Echo "CPU:"
For Each objItem In colItems
strCPU_Manufacturer = objItem.Manufacturer
strCPU_Name = objItem.Name
' WScript.Echo "CPU_Manufacturer: " & objItem.Manufacturer
' WScript.Echo "CPU_Name: " & objItem.Name
' Next
'while instr(strCPU_Name, " ") > 0
' strCPU_Name = replace(strCPU_Name, " ", " ")
'wend
WScript.Echo " CPU Manufacturer: " & vbTAB & strCPU_Manufacturer
strCPU_Name = " " & strCPU_Name
do while left(strCPU_Name,1) = " "
'wscript.echo " (CPU name is " & len(strCPU_Name) & " characters long"
strCPU_Name = right(strCPU_Name,(len(strCPU_Name)-1))
'WScript.Echo " CPU Name: " & vbTAB & vbTAB & strCPU_Name
loop
WScript.Echo " CPU Name: " & vbTAB & vbTAB & strCPU_Name
objInventoryFile.write "CPU," & strCPU_Manufacturer & "," & strCPU_Name & ",3,4,5,6,7,8,9,10" & vbCrLf
Next
A similar block of code produced similar results at my previous place of employment which used different PCs/CPUs.
Can anyone tell me why I get double output?
JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]