I've found a piece of code that should find the MAC address of the host machine in VBscript.
However, I can't seem to display the MAC address object for some reason.
The code is:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
On Error Resume Next
Dim strComputer
Dim objWMIService
Dim colItems
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration")
For Each objItem in colItems
If Not IsNull(objItem.MACAddress) Then
'Wscript.Echo objItem.MACAddress
msgBox(objItem.MACAddress)
else
msgBox("mac address is null?")
End If
Next
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
I have no idea why no message box pops up, and I don't know if ojbItem.MACAddress is a string.
If anybody could help I would be massively grateful