Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
TheHunterManX
- Posts: 54
- Joined: 14 Aug 2015 05:59
#1
Post
by TheHunterManX » 04 Jun 2017 12:02
I want to do the following:
Code: Select all
@echo off
set Input=Test
set /P Input=Type the var you want to set to 5(type nothing for Test):
call :Test %Input%
:Test
set %Input%=5
echo %Test%
pause
exit /b 0
This is an example, the file I'm working on has a LOT more call commands like the example. Is there a way for me to set the string as a variable?
-
aGerman
- Expert
- Posts: 4678
- Joined: 22 Jan 2010 18:01
- Location: Germany
#2
Post
by aGerman » 04 Jun 2017 14:07
I don't even understand your example
so I can only guess ...
Code: Select all
@echo off
set "Test=Input"
set /P "Input=Type the var you want to set to 5: "
set "%Input%=5"
echo %Test%
call echo %%%Test%%%
call call echo %%%%%%%Test%%%%%%%
pause
Steffen