Я выполняю командный файл, который проверяет, присутствует ли Java\jre6, тогда будет выполнен один тип команды, а затем, наконец, оператор else, но я нахожу, что все stmts выполняются вместе.
echo.
echo.
GOTO:Java
:Java
IF EXIST C:\Program Files\Java\jre6(
echo. Java Version 1.6 present
start /wait /d "%CD%\Message" cscript MessageBox.vbs "Java 6 thereeee"
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
XCOPY "%CD%\Sec\*.*" "%ProgramFiles%\Java\jre6\lib\security\" /s /Y
XCOPY "%CD%\Jar\*.*" "%ProgramFiles%\Java\jre6\lib\ext\" /s /Y
)
else(
XCOPY "%CD%\Sec\*.*" "%ProgramFiles(x86)%\Java\jre6\lib\security\" /s /Y
XCOPY "%CD%\Jar\*.*" "%ProgramFiles(x86)%\Java\jre6\lib\ext\" /s /Y
)
start /wait /d "%CD%\Message" cscript MessageBox.vbs "Your Settings have been installed successfully for 6"
)
IF EXIST C:\Program Files\Java\jre7(
echo. Java Version 1.7 present
start /wait /d "%CD%\Message" cscript MessageBox.vbs "Java 7 thereeee"
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
XCOPY "%CD%\Jar\*.*" "%ProgramFiles%\Java\jre7\lib\ext\" /s /Y
XCOPY "%CD%\Sec7\*.*" "%ProgramFiles%\Java\jre7\lib\security\" /s /Y
)
else
(
XCOPY "%CD%\Jar\*.*" "%ProgramFiles(x86)%\Java\jre7\lib\ext\" /s /Y
XCOPY "%CD%\Sec7\*.*" "%ProgramFiles(x86)%\Java\jre7\lib\security\" /s /Y
)
start /wait /d "%CD%\Message" cscript MessageBox.vbs "Your Settings have been installed successfully for 7"
)
IF EXIST C:\Program Files\Java\jre8(
echo. Java Version 1.8 present
start /wait /d "%CD%\Message" cscript MessageBox.vbs "Java 8 thereeee"
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
XCOPY "%CD%\Sec\*.*" "%ProgramFiles%\Java\jre8\lib\security\" /s /Y
XCOPY "%CD%\Jar\*.*" "%ProgramFiles%\Java\jre8\lib\ext\" /s /Y
)
else(
XCOPY "%CD%\Sec\*.*" "%ProgramFiles(x86)%\Java\jre8\lib\security\" /s /Y
XCOPY "%CD%\Jar\*.*" "%ProgramFiles(x86)%\Java\jre8\lib\ext\" /s /Y
)
start /wait /d "%CD%\Message" cscript MessageBox.vbs "Your Settings have been installed successfully for 8"
)
ELSE (
echo. Java NOT present
start /wait /d "%CD%\Message" cscript MessageBox.vbs "Java is not Installed In your system , install Java 1.8 and try to execute settings again"
GOTO:EXIT
)
:EXIT