结合BAT
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim s, p
Shell "cmd /c ipconfig /all > d:\1.txt"
Sleep 350
Open "D:\1.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, s
p = Mid(s, 9, 16)
If p = "Physical Address" Then
Open "D:\123.txt" For Output As #2
Print #2, Mid(s, 45)
Close #2
Exit Do
End If
Loop
Close #1
Kill "d:\1.txt"
End Sub