Hi all,
I have assigned ip address to a variable in the following way.
set /A myvar = 10.0.0.1
echo %myvar%
but it is giving the result as only 10 not entire ip address.. so can some give the solution for it
Hi all,
I have assigned ip address to a variable in the following way.
set /A myvar = 10.0.0.1
echo %myvar%
but it is giving the result as only 10 not entire ip address.. so can some give the solution for it
Can you put quotation marks around the ip address? "10.0.0.1"
Just don't use /A
, its for numerical expressions
set myvar=10.0.0.1
echo %myvar%
//10.0.0.1
Get rid of the /A
, then it will work.
C:\>help set
[...]
The /A switch specifies that the string to the right of the equal sign
is a numerical expression that is evaluated.
[...]
try this:
set myvar=10.0.0.1
echo %myvar%
The /A switch specifies that the string to the right of the equal sign is a numerical expression that is evaluated. The expression evaluator Note: no spaces around "=" sign