bat命令中的变量声明及使用

在bat文件中声明变量的方式如下:

set xxx_variant_name=yyyyyyyyyyyy

move D:abcefg est.txt %xxx_variant_name% est.txt

说明:

    01.set 那句是声明变量 xxx_variant_name,并给该变量赋值 yyyyyyyyyyyy

    02.使用变量时,需要在前后加上 %

举例:

if not exist NewFolder md NewFolder

set DestFolder=D:abcefg

move D:abcefg est.txt %DestFolder%NewFolder est.txt

原文地址:https://www.cnblogs.com/tongy0/p/5456468.html