在 Batch 中更改多个具有相似名称的变量

问题描述 投票:0回答:0
1.
@echo off
set "a=verA"
set "b=verB"
:a
echo %a1% & ^| & %b1%
echo %a2% & ^| & %b2%
pause 

2.
@echo off
set "1=hor1"
set "2=hor2"
:a
echo %a1% & ^| & %b1%
echo %a2% & ^| & %b2%
pause 

如何让变量随名字的任意字母变化?

所以我想让输出看起来像这样:

1.
verA | verB
verA | verB

2.
hor1 | hor1
hor2 | hor2
batch-file cmd
© www.soinside.com 2019 - 2024. All rights reserved.