1

如何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) 
4

2 回答 2

3

您可以在 IF 语句中添加一些括号,然后添加 ELSE

IF EXIST "%%~a\javac.exe" (
        ECHO You Have The Java Dev Kit Ignore 
    ) ELSE (
        ECHO Cannot Find JDK
    )
于 2012-07-04T08:22:12.600 回答
1
  IF EXIST "%%~a\javac.exe" (ECHO You Have The Java Dev Kit Ignore) ELSE ( do something else )
于 2012-07-04T08:24:20.020 回答