I am trying to run a batch script to get hostname and ip address and pipe to a .csv
file.
It seems I am experiencing an endless loop. I couldn't find ways to end the loop when exporting to excel. Here is my current script. I am testing to see whether this script is capable of updating from multiple PC's.
Thanks
@echo off
set ip_address_string="IPv4 Address"
echo Network Connection Test
for /F "tokens=4 delims= " %%i in ('route print ^| find " 0.0.0.0"') do set localIp=%%i
echo %ComputerName%
echo Your IP Address is: %localIp%
break
echo Export into file
forfiles /s /C "cmd /c echo %ComputerName%, %localIp%" > MyTextOutput.csv
break