J'aimerais faire un script qui permettrait de tester le réseau et la connectivité internet.
Voici mon code
@echo off :début echo 1 : Test du reseau. echo 2 : Test d'Internet. echo 3 : Partir set /p choix=Choisissez un chiffre. if %choix%==" set choix=%choix:~0,1% if %choix%==1 goto Test du reseau. if %choix%==2 goto Test d'Internet. if %choix%==3 goto Partir echo %choix% n'est pas bon! :Test du reseau. @Echo TEST DE VOTRE CONNECTIVITE...................... @ECHO En cours........................................ @ECHO ................................................ @ECHO ................................................ @Ping 192.168.1.1 @ECHO FIN DU PING if %ERRORLEVEL%=0 ( //PING = test réussi. @echo TEST OK... @echo ................................................ @echo Vous êtes connecter au réseau. ) if NOT %ERRORLEVEL%=0 ( //PING = test no réussi. @echo TEST OK... @echo ................................................ @echo Vous n'êtes pas connecter au réseau Pédagogique. ) goto:eof :goto Test d'Internet. @Echo TEST DE VOTRE CONNECTIVITE...................... @ECHO En cours........................................ @ECHO ................................................ @ECHO ................................................ Ping www.google.fr @ECHO FIN DU pING if %ERRORLEVEL%=0 ( //PING = test réussi. @echo TEST OK... @echo ................................................ @echo Vous êtes connecter à Internet. ) if NOT %ERRORLEVEL%=0 ( //PING = test no réussi. @echo TEST OK... @echo ................................................ @echo Vous n'êtes pas connecter à Internet. ) goto:eof :Partir goto:eof
Ça marche pas trop, pouvez-vous m'aider?
Merci
