A voir également:
- Script changement adresse ip windows 10
- Batch changement ip windows 10 - Meilleures réponses
- Script changement adresse ip windows 7 - Meilleures réponses
- Changement d'adresses ip avec un fichier bat ✓ - Forum - Réseau
- Windows - Changer l'adresse IP en ligne de commande avec Netsh - Conseils pratiques - Windows
- Script et adresse ip ✓ - Forum - Programmation
- Création d'un script ip fixe --> ip auto ✓ - Forum - Réseau
- Changer adresse ip (windows xp) - Forum - Réseau
1 réponse
héhé
le probleme vient du nom de ta connexion reseau local, renomme la en "lan" et ca marche
ex:
@echo off
set carte="LAN"
set adrfixe=192.168.0.14
set masque=255.255.255.0
:question
SET /P lan=Adressage IP 1/DCHP 2/FIXE 3/QUITTER (1/2/3)? :
if %lan%==1 goto IPDHCP
if %lan%==2 goto IPfixe
if %lan%==3 goto Nfin
goto question
:IPfixe
SET /P lan=confirmer l'adressage en IP Fixe 192.168.0.14 (O/N)? :
if %lan%==o goto OKFixe
if %lan%==O goto OKFixe
if %lan%==n goto Nfin
if %lan%==N goto Nfin
goto IPfixe
:OKFixe
netsh interface ip set address %carte% static %adrfixe% %masque%
goto Ofin
:IPDHCP
SET /P lan=confirmer l'adressage en IP Dynamique (O/N)? :
if %lan%==o goto OKDHCP
if %lan%==O goto OKDHCP
if %lan%==n goto Nfin
if %lan%==N goto Nfin
goto IPDHCP
:OKDHCP
netsh interface ip set address %carte% dhcp
goto Ofin
:Nfin
@echo Aucune modification n'a ete appliquee
@echo -
SET /P lan=appuyez sur [ENTREE] pour quitter
goto fin
:Ofin
@echo La nouvelle configuration vient d'etre appliquee
@echo -
SET /P lan=appuyer sur [ENTREE] pour quitter
goto fin
:fin
la en plus tu peux choisir fixe ou dhcp
donc renomme ta connexion en "lan" dans tes connexions reseau et dans ton bat
ex:
@echo off
set carte="LAN"
set adrfixe=192.168.0.14
set masque=255.255.255.0
:question
SET /P lan=Adressage IP 1/DCHP 2/FIXE 3/QUITTER (1/2/3)? :
if %lan%==1 goto IPDHCP
if %lan%==2 goto IPfixe
if %lan%==3 goto Nfin
goto question
:IPfixe
SET /P lan=confirmer l'adressage en IP Fixe 192.168.0.14 (O/N)? :
if %lan%==o goto OKFixe
if %lan%==O goto OKFixe
if %lan%==n goto Nfin
if %lan%==N goto Nfin
goto IPfixe
:OKFixe
netsh interface ip set address %carte% static %adrfixe% %masque%
goto Ofin
:IPDHCP
SET /P lan=confirmer l'adressage en IP Dynamique (O/N)? :
if %lan%==o goto OKDHCP
if %lan%==O goto OKDHCP
if %lan%==n goto Nfin
if %lan%==N goto Nfin
goto IPDHCP
:OKDHCP
netsh interface ip set address %carte% dhcp
goto Ofin
:Nfin
@echo Aucune modification n'a ete appliquee
@echo -
SET /P lan=appuyez sur [ENTREE] pour quitter
goto fin
:Ofin
@echo La nouvelle configuration vient d'etre appliquee
@echo -
SET /P lan=appuyer sur [ENTREE] pour quitter
goto fin
:fin
la en plus tu peux choisir fixe ou dhcp
donc renomme ta connexion en "lan" dans tes connexions reseau et dans ton bat
Je te remercie énormément de ta patience et de ton travail
Merci beaucoup