| 1. |
Solve : Batch File to get MAC Addresses? |
|
Answer» Hey guys can anyone help me create a batch file that will get the mac address off multiple machines and save it to a network file? you can use getmac. see getmac /? for more info. Also: I think that tool would be available via a resource kit for W2K and earlier (it's included in XP Pro and up). (just checked, it's in the NT4 resource kit and no doubt is in the w2k one). I doubt they are running an OS before XP on any of the machines anyways, though. The batch method will work with NT4 and 2000 (not as sure about NT4). getmac would be the better solution regardless- it's designed for the very purpose required. O yea should of mentioned its for XP and Win7 Quote from: BC_Programmer on January 04, 2011, 10:07:19 PM I may be wrong, but i see no options of ipconfig that can query a set of remote addresses. if OP has 60 desktops to process, then ipconfig may not work as well as getmac. Here is what I ended up with and will work just fine for what were doing. Code: [Select]echo ------------------------------------------------ >>\\server\Common\Public\getmac\MV-mac.txt echo ------------------------------------------------ >>\\server\Common\Public\getmac\MV-mac.txt echo %date% >>\\server\Common\Public\getmac\MV-mac.txt echo %COMPUTERNAME% >>\\server\Common\Public\getmac\MV-mac.txt echo %username%>>\\server\Common\Public\getmac\MV-mac.txt ipconfig /all|find "Physical Address" >>\\server\Common\Public\getmac\MV-mac.txt for /f "tokens=2 delims=:" %%i in (\\server\Common\Public\getmac\MV-mac.txt) do @echo The MAC Address is %%i Quote from: Fiala06 on January 04, 2011, 10:33:03 PM Here is what I ended up with and will work just fine for what were doing. so you have to run it on EVERY machine ? if you have a list of ip address or computer names of those 60 machines, you can use getmac with /S to query them all without having to go to every machine and run it.Quote from: ghostdog74 on January 04, 2011, 10:28:51 PM I may be wrong, but i see no options of ipconfig that can query a set of remote addresses. if OP has 60 desktops to process, then ipconfig may not work as well as getmac.Quote I have a lab of 60 desktops and would like to run a batch file on each machineNot remote. Of course a option that means they don't have to run it on each machine would be easier. Especially since it is part of the OS's in use. (and you really only need one machine that has getmac to get the various addresses)Quote from: ghostdog74 on January 04, 2011, 10:48:30 PM so you have to run it on EVERY machine ? if you have a list of ip address or computer names of those 60 machines, you can use getmac with /S to query them all without having to go to every machine and run it. Well either way I have to touch them all. These are all new computers with an image I use. There all setup with DHCP so I'll have no idea what the IP's are. We need the mac address's so we can reserve address's on our servers for each INDIVIDUAL machine. Retracted suggestion after re-reading last post. |
|