• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Noob scripting help

Shambler

Supreme [H]ardness
Joined
Aug 17, 2005
Messages
6,419
The script pasted below finds and echo's the Description field within Win32_BIOS in WMI.

I'm trying to find the significance of "objOS".

Anyone have a quick and simple answer for me?

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\Cimv2")

Set colBIOS = objWMIService.ExecQuery("Select Description from Win32_BIOS")
For Each objOS in colBIOS
Wscript.Echo "Computer Name: " & objOS.Description
Next
 
colBIOS seems to be a collection of objects returned by that query, and objOS is the name used when iterating through each of the objects in that collection.
 
Last edited:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\Cimv2")

Set colBIOS = objWMIService.ExecQuery("Select * from Win32_BIOS")
For Each objBIOS in colBIOS
Wscript.Echo "Description: " & objBIOS.Description
Next

The above script kicks out the Description without issue. However, the below script does not kick out the BIOSVersion. Error returned is a Type Mismatch.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\Cimv2")
Set colBIOS = objWMIService.ExecQuery("Select * from Win32_BIOS")
For Each objBIOS in colBIOS
Wscript.Echo "BIOS Version: " & objBIOS.BIOSVersion
Next


What am I missing?
 
Back
Top