如何在此代码中添加ELSE
部分,以便在找不到javac.exe
时,它会提供相应的找不到JDK 消息?
FOR /R "C:\Program Files" %%a IN (.) DO (
IF EXIST "%%~a\javac.exe" ECHO You Have The Java Dev Kit Ignore
Option 4)
答案 0 :(得分:3)
您可以在IF语句中添加一些括号,然后添加ELSE
IF EXIST "%%~a\javac.exe" (
ECHO You Have The Java Dev Kit Ignore
) ELSE (
ECHO Cannot Find JDK
)
答案 1 :(得分:1)
IF EXIST "%%~a\javac.exe" (ECHO You Have The Java Dev Kit Ignore) ELSE ( do something else )