0
CALL SET %PROJECT%_VERSION=1_7_0
echo %%PROJECT%_VERSION%

The result will be %PROJECT.

How can I let it to 1_7_0

1

1 Answer 1

1

Using delayedexpansion makes life easier for these types of scenarios.. You do not need to get the number of % 100% either side of the variables and no need to use call:

@echo off
setlocal enabledelayedexpansion
set "PROJECT=Projectname"
SET "%PROJECT%_VERSION=1_7_0"
echo !%PROJECT%_VERSION!
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.