Remove weird rectangle at end of line
Posted: 15 Aug 2010 08:29
Hello guys i ran the code to remove spaces for the ipconfig command and i met this problem whereby theres an invisible rectangle after .134..i am wondering how to solve this..thanks in advance:)
Result:
IPAddress............:192.168.199.134[]-< weird rectangle
Code:
SETLOCAL EnableDelayedExpansion
IPCONFIG | findstr /C:"IP Address" >> IPCONFIG.txt
for /f "delims=" %%a in (IPCONFIG.txt) do (
set line=%%a
set line=!line: =!
!
echo !line! >> IPCONFIGNS.txt
)
FOR /f "tokens=2 delims=:" %%a IN (IPCONFIGNS.txt) DO (
SET IP=%%a
)
Result:
IPAddress............:192.168.199.134[]-< weird rectangle
Code:
SETLOCAL EnableDelayedExpansion
IPCONFIG | findstr /C:"IP Address" >> IPCONFIG.txt
for /f "delims=" %%a in (IPCONFIG.txt) do (
set line=%%a
set line=!line: =!
!
echo !line! >> IPCONFIGNS.txt
)
FOR /f "tokens=2 delims=:" %%a IN (IPCONFIGNS.txt) DO (
SET IP=%%a
)