Windows Batch Files: if else

前端 未结 6 835
执笔经年
执笔经年 2020-12-24 00:42

I\'m doing a simple batch file that requires one argument (you can provide more, but I ignore them).

For testing, this is what I have so far.

if not          


        
6条回答
  •  再見小時候
    2020-12-24 01:09

    You have to do the following:

    if "%1" == "" (
        echo The variable is empty
    ) ELSE (
        echo The variable contains %1
    )
    

提交回复
热议问题