0

In MacOs I used the below command to get the machine local ip address

echo $(/usr/sbin/ipconfig getifaddr en0)

I can also set this IP address into a variable like this as well

export DISPLAY=$(/usr/sbin/ipconfig getifaddr en0)

Similarly like the above how can I get and set the ip address of Windows 10. If I execute ipconfig it prints many things but I need only the local ip address

Alex Man
  • 4,746
  • 17
  • 93
  • 178
  • Do you have access to the windows desktop? This task is usually done via GUI (I honestly have no idea if the IP can be set via command in Windows). As for system variables, there also is a GUI for it, for local and global variables. Or you just want to do/try this via command? – Jetto Martínez Feb 02 '22 at 21:13
  • @JettoMartínez I want to access this programmetically – Alex Man Feb 02 '22 at 21:14
  • Then, please see if this helps you: https://stackoverflow.com/a/59004935/10621296 – Jetto Martínez Feb 02 '22 at 21:19

1 Answers1

2

To find your IP address on Windows 10, using the command prompt, you can use the following command, ipconfig/all and press Enter. Your IP Address will display along with other LAN details.

devCharaf
  • 242
  • 2
  • 12