Windows Batch Variable within variable
问题 In windows batch could you set a variable within a variable? Explained: So the %num% is within the variable. set num=5 set cnum=test set h1=%c%num%% Is it possible to make the percents work like parenthesis? The output should be h1=test Any help would be appreciated. 回答1: Your example in your question is a mess, but I think I understand what you are looking for: @echo off setlocal set C1=apple set C2=orange set C3=banana set num=2 :: Inefficient way without delayed expansion :: This will be