If you’re like me, you constantly need your IP in Windows. When working with network interfaces and multiple servers, I find myself checking my IP a lot.
I built a little utility for myself that only shows the IP addresses on the host, rather than typing ipconfig and getting a long list, I can simply type “ip” and it will only show IP addresses.
C++ Version of the Tool
The following compiles with GCC for Windows, and probably a lot of other compilers as well. This utility is standalone and only needs to be copied into a folder within your path.
Create a file called ip.cpp and add the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
This simple executable will cut down your time by only showing the information you need at the time. I hope this helps someone.
C# Version of the Tool
I have also created a C# version of this tool, but it requires the .NET framework to be installed. Create a file called IP.cs with the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
Compile this file from the command line (csc ip.cs) and it’s ready!
Summary
These files both provide a simple executable to output your ip address where you can read it quickly. If you have multiple adapters they will show up as well.
I hope this helps!