Mon script
echo "Enter your choice (1 or 2 or 3) :" set /p dbchoice= IF %dbchoice EQU 1 ( set dbtype="oracle" ) ELSE ( IF %dbchoice EQU 2 ( set dbtype="sqlserver" ) ) ELSE ( IF %dbchoice EQU 3 ( set dbtype="db2" ) ) ELSE ( echo "Incorrect choice" )
J’obtiens la sortie suivante:
E:\csmilm>set /p dbchoice= 1 ELSE was unexpected at this time. E:\csmilm>) ELSE ( E:\csmilm>
Quel est le problème ici?
Fermeture des supports au mauvais endroit Essayer:
IF %dbchoice EQU 1 ( set dbtype="oracle" ) ELSE ( IF %dbchoice EQU 2 ( set dbtype="sqlserver" ) ELSE ( IF %dbchoice EQU 3 ( set dbtype="db2" ) ELSE ( echo "Incorrect choice" ) ) )