BGinfo "Network Card" internal string name; what is it?

Bob Hurd 21 Reputation points
2021-01-22T18:24:08.693+00:00

I an trying to display BGinfo's Network Card name without some extraneous information that is on the end of the Network Card description that BGinfo displays. The problem is that I don't know what the string name BGinfo uses for "Network Card". I know how to remove the added information at the end of a field using vbs, but I need to know what that field name is called.

This should be a simple question to answer, but I cannot locate that information anywhere.

Thank you.

bob

Sysinternals
Sysinternals
Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
1,087 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 48,281 Reputation points
    2021-01-22T19:16:48.217+00:00

    OK so you're using WMI to retrieve this information via VBScript. Here's the auto-generated VBS code from WMI Code Creator that appears to get the display name of the adapter that should match what BGInfo is pulling, based upon my simple testing.

    Set adapters = objWMI.ExecQuery("SELECT * FROM Win32_NetworkAdapter",,48) 
    For Each objItem in adapters
        Wscript.Echo "-----------------------------------"
        Wscript.Echo "Win32_NetworkAdapter instance"
        Wscript.Echo "-----------------------------------"
        Wscript.Echo "Name: " & objItem.Name
    Next
    

    FYI, VBS is an old tech that isn't very performant and has been deprecated. I might recommend that you consider switching to Powershell which is supported on all versions of Windows, is faster and easier and has a lot more functionality. You can run PS scripts just like VBS scripts and it is effectively the replacement for the command prompt. Just something to consider.


2 additional answers

Sort by: Most helpful
  1. Michael Taylor 48,281 Reputation points
    2021-01-22T18:42:24.793+00:00

    You didn't mention how you're getting this information outside of BGInfo (Powershell, C#, etc). On the 2016 Servers I manage it appears to be using the Device Description or DIsplay Name. I tested on Win 10 and it is using Display Name to distinguish between multiple adapters with the same driver (e.g. Hyper-V or vmWare adapters). So I would say it is using DIsplay Name. How you get that information programmatically is determined by what client you're using though.

    0 comments No comments

  2. Bob Hurd 21 Reputation points
    2021-01-22T18:57:27.433+00:00

    I am using vbs to extract the information from BGinfo. For clarity's sake, I am displaying the information on the desktop with other BGinfo "standard" information. For instance, I used the following code to extract whether we are under Standard Time or Daylight savings time and stored it in the variable "TZ".

    Set Win32Computer = objWMI.ExecQuery("SELECT * FROM Win32_ComputerSystem")

    For Each Item In Win32Computer
    DaySave = Item.DaylightInEffect
    Next

    Set Items = objWMI.ExecQuery("SELECT * FROM Win32_TimeZone")

    For Each TimeItem In Items
    DayDST = TimeItem.DaylightName
    DaySTD = TimeItem.StandardName
    Next

    If DaySave <> "True" then
    TZ = DaySTD
    Else
    TZ = DayDST
    End If

    Echo TZ

    0 comments No comments