Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VBscript and WMI help

Featured Replies

Hi there,

Firstly i am not a programmer by any means, however i have in the past couple of days being teaching myself as i go some VBscript. I started off working with a Script By Gunsmokingman that automates oeminfo.ini creation. The problem with the original is that it was written for Vista and i wanted to use it with XP. Anyway after much investigation and trial and error i have managed to get most of the things working i wanted to have in the script and have added some new features also. The one problem i am having that i haven't found a solution to is that in a system with multiple NIC's i want to simply add the the default Nic (Local Area Connection) to the OEMinfo.ini file. I have everything i need except i can't seem to get the correct IP address added - it adds the last in the array.

Anyway below is the portion code i have been working with and i would greatly appreciate it if one of you VB guru's can help with out with some clues to solving this issue.

   '/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("Select IPAddress, MACAddress from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
'/----------------------------------------------------------------------->
For Each objItem in colItems
If Not IsNull(objItem.IPAddress) Then
For i=LBound(objItem.IPAddress) To UBound(objItem.IPAddress)
IP = objItem.IPAddress(i)
Next
End If
Next
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery( "SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionID = 'Local Area Connection'")
'/----------------------------------------------------------------------->
Cnt = 1
For Each objItem in colItems
If Cnt = 1 Then
C1 = C1 +1
Ts.WriteLine "Line" & C1 & "=" & TitleL & "NETWORK ADAPTER INFORMATION" & TitleR
C1 = C1 +1
Ts.WriteLine "Line" & C1 & "=" & S_3 & "Adapter Name " & vbTab & objItem.Name
C1 = C1 +1
Ts.WriteLine "Line" & C1 & "=" & S_3 & "Manufacturer By " & vbTab & objItem.Manufacturer
C1 = C1 +1
Ts.WriteLine "Line" & C1 & "=" & S_3 & "IP Address " & vbTab & IP
C1 = C1 +1
Ts.WriteLine "Line" & C1 & "=" & S_3 & "MACAddress " & vbTab & objItem.MACAddress
C1 = C1 +1
Ts.WriteLine "Line" & C1 & "="
Exit For
End If
Next
Cnt = 0

Cheers,

Felix


Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.