|I need some way of getting the IP address of a computer as a variable in a batch file. This doesn't work (this code was posted on this forum and I don't remember the posters name(sorry)):|
IPCONFIG |FIND "IP" > %temp%\TEMPIP.txt
FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do set IP=%%a
echo %IP% >%temp%\ip.txt
echo The current IP address is "%IP%"
But all this yields is:
"FIND: IP: No such file or directory"
"The current IP address is "~1""
"Press any key to continue . . ."
Does anyone have a way that works on Windows XP, Vista and 7?