Increment the number using batch script

November 4, 2014 at 03:20:42
Specs: windows
Hi,

i have the version.txt file and it has TEST_VERSION_V01 if i build each time it needs to be increment like TEST_VERSION_V02. I have the batch file:

@echo off
setLocal enableDelayedexpansion
for /f "usebackqtokens=3 delims=_" %%a in ("path\version.txt") do (
echo "before update:%%a"
%%a+1
echo "after update:%%a"
)

i am getting the output as
before update:1
1+1 is not recognized as internal or external command, operable program or batch file.
after update:1

please help me to solve this

thanks in advance.


See More: Increment the number using batch script

Report •

#1
December 4, 2014 at 12:06:37
C:\>set /A x=x+1
1
C:\>echo %x%
1

C:\>set /A x=x+1
2
C:\>echo %x%
2

C:\>set /A x=x+1
3
C:\>echo %x%
3

C:\>


Report •
Related Solutions


Ask Question