16
测试批处理文件中参数是否为空的正确方法是什么?
我需要测试是否设置了变量。我已经尝试了几种技术,但他们忽视了,只要%1用双引号包围时,如情况%1是"c:\some path with spaces"。 IF NOT %1 GOTO MyLabel // This is invalid syntax IF "%1" == "" GOTO MyLabel // Works unless %1 has double quotes which fatally kills bat execution IF %1 == GOTO MyLabel // Gives an unexpected GOTO error. 根据本站点的介绍,这些是受支持的IF语法类型。因此,我没有找到一种方法。 IF [NOT] ERRORLEVEL number command IF …
213
windows
shell
batch-file
cmd