samedi 30 septembre 2017

Batch file, If Statement not working

The following if statement is not running. It just ends the bat file It stops the process. Why is this happening? How do I stop it?

    if "%Choice%"=="si" (GOTO Case2) else (
        if "%Choice%"=="s" (GOTO Case1) else (
            if "%Choice%"=="ti" (GOTO Case4) else (
                if "%Choice%"=="t" (GOTO Case3) else (
                    if "%Choice%"=="i" (GOTO Case5) else (
                        if "%Choice%"=="cp" (GOTO Case6) else (
                            if "%Choice%"=="kp" (GOTO Case7) else (
                                if "%Choice%"=="?" (GOTO CaseHelp) else (
                                    if "%Choice%"=="c" (GOTO Case8) else (
                                        if "%Choice%"=="sl" (GOTO Case9) else (
                                            if "%Choice%"=="sf" (GOTO Case10) else (
                                                if "%Choice%"=="fz" (GOTO Case11) else (
                                                    if "%Choice%"=="dc" (GOTO Case12) else (
                                                        if "%Choice%"=="cm" (GOTO Case12) else (
                                                            if "%Choice%"=="wh" (GOTO Case13) else (
                                                                if "%Choice%"=="vs" (GOTO Case14) else (
                                                                    if "%Choice%"=="it" (GOTO Case15) else (
                                                                        if "%Choice%"=="tm" (GOTO Case16) else (
                                                                            if "%Choice%"=="d" (GOTO Case17) else (
                                                                                if "%Choice%"=="ed" (GOTO Case18) else  (
                                                                                    if "%Choice%"=="be" (GOTO Case19) else (
                                                                                        if "%Choice%"=="me" (GOTO Case20) else (
                                                                                            if "%Choice%"=="ap" (GOTO Case21) else (
                                                                                                if "%Choice%"=="pc" (GOTO Case22) else (
                                                                                                    if "%Choice%"=="sc" (GOTO Case23) else (
                                                                                                        if "%Choice%"=="c" (GOTO Case24) else (
                                                                                                            if "%Choice%"=="ll" (GOTO Case25) else (
                                                                                                                if "%Choice%"=="ij" (GOTO Case26) else (
                                                                                                                    GOTO CaseError)
                                                                                                )
                                                                                            )
                                                                                        )
                                                                                    )
                                                                                )
                                                                            )
                                                                        )
                                                                    )
                                                                )
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )

Also, is there an alternative of using an if statement as this method is uite time consuming.

Aucun commentaire:

Enregistrer un commentaire