windows 7 - Math on batch (win) -
I am developing a CMD batch, I want to do some math in it. This formula: (x + 1) 100: y
in batch, x =% x%, and y =% y%
. I know how to define the variable now, how can this calculate the batch? (Windows CMD)
Do I need some extra?
(I need that for windows XP users are available in 7.)
The set command supports a limited number of calculations. In your case, you want:
set / a result = (100 * x) / y
play set /?
to see supported documents. The / a
switch also allows automatic variable adoption, so you can use x
instead of x x
.
Comments
Post a Comment