RosettaCodeData/Task/Dynamic-variable-names/Batch-File/dynamic-variable-names.bat
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

14 lines
315 B
Batchfile

@echo off
setlocal enableDelayedExpansion
set /p "name=Enter a variable name: "
set /p "value=Enter a value: "
::Create the variable and set its value
set "%name%=%value%"
::Display the value without delayed expansion
call echo %name%=%%%name%%%
::Display the value using delayed expansion
echo %name%=!%name%!