我看到一個Windows批處理文件如下驅動:檢查命令行參數是使用IF
..
::Handle the case where the install dir is specified as a drive
if not "%1" == "" if /I "%1" == "%~d1" set INSTALL_DIR=%~d1
..
問題1:我從來沒有看到兩個if語句一起使用,這樣。它是否像AND一樣,即(persudo代碼:((「%1」!=「」)和(%1 ==「%〜d1」))?
問題2:它似乎會設置INSTALL_DIR只有1%是一個驅動器,但不是單次檢查已經足夠了嗎?
if /I "%1" == "%~d1" set INSTALL_DIR=%~d1