Exemples de batch Windows
Menu Batch
@echo off
cls
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º Network Configuration º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
echo 1. Premier
echo 2. Second
echo 3. Fin
echo.
echo Votre choix ?
set /p Input=
if %input% GEQ 3 goto end
if %input% EQU 2 goto second
if %Input% EQU 1 goto first
:first
echo Premier choix
goto end
:second
echo Second choix
:end
pause
exit
Commandes réseau
Pour configurer un réseau statiquement par ligne de commande, on peut lancer les commandes suivantes.
netsh interface ip set address name="Connexion au réseau local 6" static 192.168.1.100 255.255.255.0 192.168.1.1 1
netsh interface ip set dns name="Connexion au réseau local 6" static 192.168.1.1
netsh interface ip add dns name="Connexion au réseau local 6" 192.168.1.1 index=2
netsh interface ip show address
netsh interface ip show dns
ipconfig
Pour revenir à une configuration dynamique, les commandes sont les suivantes.
netsh interface ip delete dns name="Connexion au réseau local 6" all
netsh interface ip set address name="Connexion au réseau local 6" dhcp
ipconfig /all