I'm having trouble with using an if else statement in a batch command. I'm running Windows XP. I wrote a simple batch file to output my ip address which works fine. However, I would like to include "No ip address found" if there isn't any ip address to be shown. I've looked at similar questions on here but can't find a solution for this.
Here is the code I have (which works fine for when there is an ip address)
@echo off
color 02
mode con:cols=60 lines=3
Title What's my ip?
:start
echo.
echo Here is your ip address!
ipconfig > nul
ipconfig > nul
ipconfig > nul
cls
echo.
ipconfig | find "IP Address"
ipconfig > nul
ipconfig > nul
ipconfig > nul
ipconfig > nul
Any help would be much appreciated. Thanks.