如何使用其他变量更改环境变量的名称? [英] How to change the name of an environment variable with a different variable?
本文介绍了如何使用其他变量更改环境变量的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种方法可以使用批处理文件中的另一个环境变量来动态命名环境变量?
Is there a method to name an environment variable dynamically using another environment variable in a batch file?
类似
numplayers=3
char%numplayer%atk=12
echo char3atk
有输出
12
推荐答案
这很简单:
SET numplayers=3
SET char%numplayers%atk=12
ECHO %char3atk%
这篇关于如何使用其他变量更改环境变量的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文