I am having trouble getting this simple code to display the ip address in between <p>/</p> HTML tags.
The code below works, outputting to a text file is ok.
if /i %opt%==1 ipconfig |findstr "IPv4">>"..\LOGS\%NAME%\%serial% %MAC%".txt
The code below is where I would like to embed the CMD code but it just ignores the code or prints in plain text depending on how I modify it; would it need escape characters?
^<td width="38%%" class="table-border-left"^>^<p^>IP Address^</p^>^</td^>
and output to a HTML file:
>> "..\LOGS\NAME%\%serial% %MAC%".html
Any suggestions?
Your question is essentially, 'How do I obtain just the IPv4 Address from ipconfig.exe, and use it'?
batch-file example using your ipconfig command, (the result is returned as
%%J):The above is a single line command, which has been split to work without modification, but remain readable. If you want to run it as a single line then it would look like this:
Please note that there may be more than one adapter bound to TCP/IP, so you may see more than one result returned