Doc Symbiosis Posted January 6, 2006 Posted January 6, 2006 Hi there,In a batchfile, I need to get the MAC-address of "Local Area Connection" into a variable, but still can't figure out how. There aren't any adequate parameters for the getmac and ipconfig command. Thought about using the find command, but there's a problem, when more than one network adapter is installed. How do I get the one of "Local Area Connection"Does anyone have an idea?Thanks in advanceTitle Edited - Please follow new posting rules from now on.--Zxian
Synapse Posted January 7, 2006 Posted January 7, 2006 well ipconfig /all will display the mac address, but you would have to search through it..or theres a tool from Microsoft called getmac.exe you would have to download and run their installer, but then you could just put getmac32.exe into your $$\system32\ folder and it'd be included every time you use your unattended xpcd (if you use one at all)http://www.microsoft.com/windows2000/techi...ng/getmac-o.aspOutput of the tool:1st MAC is loopback2nd MAC is my Ethernet card3rd MAC is my VMWare Ethernet cardmarked everything out in red cause i have no idea what MAC addresses says (vendor model etc..) or what the GUID may say about the system... can never be too paranoid hope this helps.
Doc Symbiosis Posted January 7, 2006 Author Posted January 7, 2006 Thanks Bi0haZarD, even if I just found a compiled batchfile called MacID, which you can call with adequate parameters, e.g. MacID 0 to get the MAC-Adress of the network adapter with ID 0.
Takeshi Posted January 8, 2006 Posted January 8, 2006 (edited) Systeminfo will say which NIC is Local Area Connection. That's the only command that I find will say that, even wmic nic list (and other wmic parameters) won't. Perhaps you could use both.(Getmac is already available in XP). Edited January 8, 2006 by Takeshi
Synapse Posted January 8, 2006 Posted January 8, 2006 (edited) wow lol. i don't even remeber posting that last night i was so tired.. reading it now and i have no idea why i mentioned getmac in my post since you had mentioned it in your post..anyways.. for anyone that may still want this..you'll have to have getmac (comes default with windows... mine didn't come with it for some reason... stupid emachines..)FOR /F %%A IN ('getmac') DO SET MAC=%%Aand that will set the bottom most mac address to %MAC%works great for systems with only 1 network card. I could probably go further and have it validate against the nbtstat -a ipaddresshere to get the "true" MAC.. but i'm getting tired..and i'm sure we all don't want another stupid reply by me Edited January 8, 2006 by Bi0haZarD
Doc Symbiosis Posted January 8, 2006 Author Posted January 8, 2006 Thanks, but there's no need for it. I also tired a time with wild consntruction with getmac or ipconfig /all, but since I have installed three network adapters, It's little hard. But with the compiled batch I found, it's o problem.Have a nice day
Synapse Posted January 8, 2006 Posted January 8, 2006 could ya send me the link to this MacID batch file? incase i ever need it later on.thanks
Doc Symbiosis Posted January 8, 2006 Author Posted January 8, 2006 (edited) http://www.mirkes.de/de/freeware/batch.php.Unfortunately the homepage is in german. Just follow the link on the top, where it says "herunterladen". The help of the commands is in englisch. Edited January 8, 2006 by Doc Symbiosis
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now