tags:

views:

42

answers:

4

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

A: 

Can you put quotation marks around the ip address? "10.0.0.1"

Senica Gonzalez
A: 

Just don't use /A, its for numerical expressions

set myvar=10.0.0.1
echo %myvar%
//10.0.0.1
S.Mark
A: 

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.
[...]
Anders Lindahl
A: 

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

stasetz