[SOLVED] I need my IP Address (With a twist)

everseeker

Prominent
Oct 13, 2018
9
0
510
Hi. I have a dirt simple batch file that takes my IPConfig data and sends it to my home email (I connect remotely and the office is ...fond... of moving the PC around... So I need to have it kinda call home every night (When I come online)
While that's all fine... I would love to get an email that JUST has my IP (I could actually TEXT that...)
Is there a windows command or ??? that just returns the IP address?

Even somehow parsing to pull the line
IPv4 Address. . . . . . . . . . . : 99.99.99.99(Preferred)
would be enough
 
Solution
Sure, just use the pipe "|" command and the findstr command

ipconfig.exe /all | findstr.exe "IPv4" That creates a one line result.

Use your specific results to determine what to search for.
Why not use your computer name instead of IP, then IP change won't matter. As long as your DNS in the office is setup properly.
Or set a static IP on the computer so it does not change? Seems a lot of extra work when there are simpler solutions.
If this is your own system in the office, you can also move it to a place where it won't need to get moved. We have setup lots of systems for remote access that just sit in a cube without even a monitor or mouse/keyboard attached, just a network cable.