Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim Description As String
Dim Mac As String
Shell "cmd.exe /c ipconfig /all >""" & App.Path & "\temp.tmp" & """", vbHide
Do Until Dir(App.Path & "\temp.tmp") <> ""
DoEvents
Loop
Sleep 1000
Open App.Path & "\temp.tmp" For Input As #1
Do While Not EOF(1)
Line Input #1, a
If Left(a, Len(" Description . . . . . . . . . . . :")) = " Description . . . . . . . . . . . :" Then
Description = Right(a, Len(a) - Len(" Description . . . . . . . . . . . :"))
End If
If Left(a, Len(" Physical Address. . . . . . . . . :")) = " Physical Address. . . . . . . . . :" Then
Mac = Right(a, Len(a) - Len(" Physical Address. . . . . . . . . :"))
End If
Loop
Close #1
Kill App.Path & "\temp.tmp"
MsgBox "Description:" & Description
MsgBox "Mac:" & Mac
End Sub