MAC Address - find it

btsdev

Member
Oct 6, 2001
186
0
0
I can't seem to remember how to get the MAC address for my W2000 machine. On an XP machine its "getmac". any clues out there?
 

gsellis

Diamond Member
Dec 4, 2003
6,061
0
0
And if you need a script...


Set WshShell=WScript.CreateObject("WScript.Shell")
Set WshNetwork=WScript.CreateObject("WScript.Network")
Set fs = CreateObject("Scripting.FileSystemObject")

strUser = WshNetwork.UserName

' Open output file
strfilename = WshShell.ExpandEnvironmentStrings("%temp%") & "\\myinfo.txt"
If fs.FileExists(strfilename) Then
fs.DeleteFile strfilename, TRUE
End If

Set t = fs.CreateTextFile(strfilename, True)

t.WriteLine(" ")
t.WriteLine("==== Non-MS Network Adapters ============ ")
Set tempSet = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select DeviceID,Description,Manufacturer,MACAddress from Win32_NetworkAdapter")

For each DeviceID in tempset
If DeviceID.Manufacturer <> "Microsoft" then
strTempLine = DeviceID.Description & " MAC: " & DeviceID.MACAddress
t.WriteLine(strTempLine)
End If
Next
t.Close