Probleme variable batch
Résolu/Fermé
A voir également:
- Probleme variable batch
- Fichier batch - Guide
- Extension batch - Forum Windows
- Vba excel sélectionner une plage de cellules variable ✓ - Forum VB / VBA
- Batch color - Forum Autoit / batch
2 réponses
cs-bilou
Messages postés
769
Date d'inscription
dimanche 2 décembre 2007
Statut
Membre
Dernière intervention
24 février 2011
164
14 févr. 2010 à 16:20
14 févr. 2010 à 16:20
Bon alors voilà où est le problème:
Il te manque les % autour des choixmenu.
De plus si tu met "1" d'un coter de l'illégalité il faut mettre aussi les " a %choixmenu%. Mais je te conseille de les mettre nulle part.
Enfin pour la dernière ligne IF choixmenu == "5" GOTO :fin change plutôt le 5 en 6.
Voilà le code quand tout a était modifier:
Bilou.
IF choixmenu == "1" GOTO :1 IF choixmenu == "2" GOTO :2 IF choixmenu == "3" GOTO :3 IF choixmenu == "4" GOTO :4 IF choixmenu == "5" GOTO :5 IF choixmenu == "5" GOTO :fin
Il te manque les % autour des choixmenu.
De plus si tu met "1" d'un coter de l'illégalité il faut mettre aussi les " a %choixmenu%. Mais je te conseille de les mettre nulle part.
Enfin pour la dernière ligne IF choixmenu == "5" GOTO :fin change plutôt le 5 en 6.
Voilà le code quand tout a était modifier:
@ECHO OFF CLS ECHO Choisir options : ECHO 1. option 1 ECHO 2. option 2 ECHO 3. option 3 ECHO 4. option 4 ECHO 5. option 5 ECHO 6. Quit ECHO. SET /p choixmenu=Taper un chiffre entre 1 et 5 : IF %choixmenu% == 1 GOTO :1 IF %choixmenu% == 2 GOTO :2 IF %choixmenu% == 3 GOTO :3 IF %choixmenu% == 4 GOTO :4 IF %choixmenu% == 5 GOTO :5 IF %choixmenu% == 6 GOTO :fin echo %choixmenu% n'est pas bon ! GOTO :menu :1 ECHO 1 PAUSE GOTO :fin :2 ECHO 2 PAUSE GOTO :fin :3 ECHO 3 PAUSE GOTO :fin :4 ECHO 4 PAUSE GOTO :fin :5 ECHO 5 PAUSE GOTO :fin :fin EXIT
Bilou.