jeudi 28 septembre 2017

multiple if statements in batch not executing but everything else works

OK I'm trying to make a batch program to execute multiple java programs in a set place based on the user input. the directory part works the only thing that seems to cause me trouble is the if statements running the java programs.here is my code:

@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 help I'm lost and i feel like i have tried everything thanks :)

Aucun commentaire:

Enregistrer un commentaire