How to get network ip address via windows command prompt?

You can view all the configured IP addresses using this command:

netsh interface ip show address | findstr "IP Address"

You can also add the adapter name to get IP address of a specific network interface.

netsh interface ip show address "Ethernet" | findstr "IP Address"

This should work in at least latest versions of Windows.


I wrote a proper ip4 command out of similar frustration.

ip4

(.exe is here)


Another valid way is via WMIC:

wmic NICCONFIG WHERE IPEnabled=true GET IPAddress

This will show the IP address if there is one and the adapter that has it configured is enabled. Quite useful in many situations.