Demander un choix dans un batch
Posté le 1 février, 2009 dans Batch, Windows | Aucun Commentaire »
Pour demander un choix dans un script batch :
@echo off :debut echo 1) choix 1 echo 2) choix 2 set /p CHOIX=Quel est votre choix ? echo Votre choix est : %CHOIX% if '%CHOIX%' == '' goto erreur rem if not '%CHOIX%' == '1' goto erreur rem if not '%CHOIX%' == '2' goto erreur goto ok :erreur echo Erreur goto debutk echo Votre choix est : %CHOIX%