我想运行一个cmd.exe,它会在调用时计算环境变量而不是解析命令时。如果我将BASE设置为2并回显它,我应该看到数字2,尽管运行此脚本未正确设置基础。
预期行为:
实际行为:
预期行为:
C:\Users\schristo>cmd.exe /X /C "set BASE=2 && echo %BASE% && pause"
2
Press any key to continue . . .
实际行为:
C:\Users\schristo>cmd.exe /X /C "set BASE=2 && echo %BASE% && pause"
%BASE%
Press any key to continue . . .