Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Locales and NIC speed settings

Status
Not open for further replies.

josephk73

Technical User
Aug 1, 2002
115
GB
Hi All,

Does anybody know where in the registry/wmi the follwing information is held?

- speed for installed network cards
- regional settings for the local computer (ie GMT, USA etc)

I can code a script to extract the info, I just need to know where to get it from.

Thanks.
 
Code:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter",,48)
For Each objItem in colItems
    Wscript.Echo "AdapterType: " & objItem.AdapterType
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "DeviceID: " & objItem.DeviceID
    Wscript.Echo "MACAddress: " & objItem.MACAddress
    Wscript.Echo "Manufacturer: " & objItem.Manufacturer
    Wscript.Echo "MaxSpeed: " & objItem.MaxSpeed
Next

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
    Wscript.Echo "Locale: " & objItem.Locale
Next

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in colItems
    Wscript.Echo "CurrentTimeZone: " & objItem.CurrentTimeZone
    Wscript.Echo "DaylightInEffect: " & objItem.DaylightInEffect
Next

Note that the locale will return the code for the country.

I hope you find this post helpful.

Regards,

Mark
 
markdmac,

Thanks for the response. The query for the timezone works, but the query to select nic speed from the Win32_NetworkAdapter class does not give the NIC speed. I have been doing some reading on the MS site and it would seem that not all properties have been initialised in this class and NIC speed being one of them. Unfortunate, but I'm going to have look at an alternative, perhaps some kind of tool or something. Anycase, thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top