Thrive X
Thrive X

Reputation: 9

How add a a number to a variable in batch

Hey I'm working on a project of mine in batch. yes I know its bad but I'm using it anyways. I was trying to make an updating inventory system when I ran into this problem. I was trying to add a set number E.X 1 to a variable like this:

@echo off
set var=0
echo I will add these numbers from var+1
set /a var=%var%+1
pause
echo var
pause

what is the problem?

Upvotes: 0

Views: 250

Answers (1)

Magoo
Magoo

Reputation: 80023

To show the value of the variable var, you need

echo %var%

Upvotes: 2

Related Questions