I have the name of a computer on the network, and I need to know how to get the ip address of said computer from a batch file? Thanks.
Networking – How to get the ip address of a computer from its hostname?
batchhostnameiplannetworking
batchhostnameiplannetworking
I have the name of a computer on the network, and I need to know how to get the ip address of said computer from a batch file? Thanks.
Best Answer
Your problem can be solved via command. Like the picture I posted below. You may have mistakenly marked the yellow mark as a MAC address, but they are actually IPv6 addresses. When you use the ping command, you can add "-4" behind the host name to display the IPv4 address.
I also have a batch file that returns the hostname and IP address of the computer at the same time. You can write the following code to a txt file and change the extension to
.bat
. Then double-click the file to get the computer name and ip address. I hope this will help you.Code: