I have seen a lot of batch script that get MAC address or change IP address for a ethernet card. None of them worked for me. I need a batch script that will be able to get MAC addresses and compares MACs with a given MAC as parameter, and find the name of the ethernet card, and then set the IP address for this name. I am using win8.1 German, so it should also work in English Windows but this functionality can be ignored for the first step.
So What I need:
1) Parse ipconfig /all command and find the name of the ethernet card for a MAC address, that is given as parameter.
2) Take the name of the ethernet card and set a new IP address for this name with command netsh int ip set address...
Problems:
getmac command outputs following:
Code: Select all
Physisch. Adresse Transportname
=================== ========================
11-22-33-44-55-66 Nicht zutreffend
77-88-99-AA-BB-CC Medien ausgeworfen
DD-EE-FF-00-11-22 Medien ausgeworfen
Nicht zutreffend Hardware nicht vorhanden
00-11-22-33-44-55 Medien ausgeworfen
As you can see, getmac command doesn't display the name of the interface.
To cut a long story short, the batch script takes a MAC address and IP address as parameter and change the IP address for this interface that has that given MAC.
Thanks.