Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Question] - Get MAC into variable in batchfile

Featured Replies

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 advance

Title Edited - Please follow new posting rules from now on.

--Zxian


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.asp

Output of the tool:

gdfgdfgdfgdfg5fh.jpg

1st MAC is loopback

2nd MAC is my Ethernet card

3rd MAC is my VMWare Ethernet card

marked 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 :P

hope this helps.

  • Author

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.

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 by Takeshi

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=%%A

and 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 :P

Edited by Bi0haZarD

  • Author

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

could ya send me the link to this MacID batch file? incase i ever need it later on.

thanks

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.