Sunday, April 9, 2023

Bginfo on Windows 10 and show active IPv4 address only

To run Bginfo to ALL users:

 

Now navigate to the location of the shortcut and edit the target path to be the following:

 

"C:\Tools\BGInfo\Bginfo64.exe" "C:\Tools\BGInfo\config.bgi" /timer:0 /nolicprompt /silent

 

Next Copy that shortcut and it in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"

 

Reference:

https://serverfault.com/questions/451791/run-bginfo-at-startup-for-all-users

 

 

For show active IP v4 only, there are vb script:

 

strMsg = ""

strComputer = "."

 

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

Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'")

 

For Each IPConfig in IPConfigSet

If Not IsNull(IPConfig.IPAddress) Then

For i = LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)

  If Not Instr(IPConfig.IPAddress(i), ":") > 0 Then

  strMsg = strMsg & IPConfig.IPAddress(i) & vbcrlf

  End If

Next

End If

Next

 

Echo strMsg

 

IP.vbs

 

Reference:

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/bb74c2eb-eca2-455d-a270-8dd0f3d195e6/wmi-query-to-retrieve-only-active-ipv4-address?forum=ITCG

 

Print Friendly and PDF
Share/Bookmark

No comments:

Post a Comment