1
如何添加ELSE
部分到此代碼,以便如果它找不到javac.exe
它會給出相應的找不到JDK消息?If/else命令語法批量編輯
FOR /R "C:\Program Files" %%a IN (.) DO (
IF EXIST "%%~a\javac.exe" ECHO You Have The Java Dev Kit Ignore
Option 4)
如何添加ELSE
部分到此代碼,以便如果它找不到javac.exe
它會給出相應的找不到JDK消息?If/else命令語法批量編輯
FOR /R "C:\Program Files" %%a IN (.) DO (
IF EXIST "%%~a\javac.exe" ECHO You Have The Java Dev Kit Ignore
Option 4)
您可以將某些括號添加到您,如果statment,並添加ELSE之後
IF EXIST "%%~a\javac.exe" (
ECHO You Have The Java Dev Kit Ignore
) ELSE (
ECHO Cannot Find JDK
)
IF EXIST "%%~a\javac.exe" (ECHO You Have The Java Dev Kit Ignore) ELSE (do something else)
快速谷歌搜索帶來了以下鏈接:http://www.robvanderwoude.com /ntif.php – Amir
你已經問過關於它的[一個問題](http://stackoverflow.com/questions/11324685/if-exist-and-else-in-batch),並且你有了答案。或者你不是? –