批处理中的多个if语句未执行但其他所有内容都有效

时间:2017-09-28 19:36:21

标签: batch-file variables if-statement

好的我正在尝试根据用户输入制作批处理程序以在设定的位置执行多个java程序。目录部分工作唯一似乎导致我麻烦的是运行java程序的if语句。这是我的代码:

(编辑:所以此时if语句有效,但里面的代码不会执行任何建议吗?)

@echo off
:START
echo Last Name First Initial:
set /p Name=""
cls.
echo %Name%
setlocal enabledelayedexpansion
echo BLP or BPP or LMP:
set /p Type=""
cls.
echo %Name%
echo %Type%

echo Chapter Number:
set /p ChapterNumber=""
set ch=ch
set Chapter=%ch%%ChapterNumber% 
cls.

echo %Name%
echo %Type%
echo %Chapter%
pause

r:
cd R:\4\%Name%\%Type%\%Chapter%\
dir

IF "%Type%"=="lmp" (

IF "%Chapter%"=="ch1" (
echo.
echo CSYes
echo.
java CSYes
echo.
echo Poem
echo.
java Poem
echo.
echo Count
echo.
java Count
echo.
echo Simple
echo.
java Simple
echo.
echo Hello
echo.
java Hello
echo.
echo Problems
echo.
java Problems
echo.
pause
cls
goto :START
)

IF "%Chapter%"=="ch2" ( 

    )
)


IF "%Type%"=="bpp" (

IF "%Chapter%"=="ch1" (
echo.
echo Novel
echo.
java Novel
echo.
echo Song
echo.
java Song
echo.
echo Tree
echo.
java Tree
echo.
echo Websites
echo.
java Websites
pause
cls
goto :START
)

IF "%Chapter%"=="ch2" (


)
)


pause
cls.
goto :START

pleeeease帮助我迷失了,我觉得我已经尝试了一切,谢谢:)

0 个答案:

没有答案