S
SHULTZ
hi all
I want to generate a batch file that save a
IP address to a variable.
Whit the command : ipconfig |find "Indirizzo"
I have this :
Indirizzo IP. . . . . . . . . . . . . : xxx.xxx.xxx.xxx
I use this script to put the IP address in a variable but
not run very well:
::version a) :
@echo off
for /f "tokens=2 delims=:" %a in ('ipconfig ^|find "Indirizzo IP" /i')
do
@echo IP Address is %a
::version b):
@echo off
ipconfig |find "Indirizzo" >ip.txt
for /f "tokens=2 delims=:" %a ip.txt do
@echo IP Address is %a
Both the versions not run
Where is my errors?
thanks.
I want to generate a batch file that save a
IP address to a variable.
Whit the command : ipconfig |find "Indirizzo"
I have this :
Indirizzo IP. . . . . . . . . . . . . : xxx.xxx.xxx.xxx
I use this script to put the IP address in a variable but
not run very well:
::version a) :
@echo off
for /f "tokens=2 delims=:" %a in ('ipconfig ^|find "Indirizzo IP" /i')
do
@echo IP Address is %a
::version b):
@echo off
ipconfig |find "Indirizzo" >ip.txt
for /f "tokens=2 delims=:" %a ip.txt do
@echo IP Address is %a
Both the versions not run
Where is my errors?
thanks.