在我的批处理文件中我有脚本:
set myVar=/someLabel:"%1"
我想为上面的脚本编写 if
命令,其含义与下面相同。
if <%1 not null> {
myVar=/someLabel:"%1"
}
else
{
myVar=""
}
我该怎么做?
[编辑]
用户 hfs
的回答对我有用。
最佳答案
set myVar=
if not "%1" == "" set myVar=/someLabel:%1
关于windows - 使用命令行的引用参数时如何进行条件检查(if 命令)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3930918/