editediteditedit

IP Adresa přes cmd ve Windows


Rychlé nastavení ip adresy ve win (má eště pár much)
Kd: set ip via cmd
@echo off

:vyber_akce
echo.
echo Nastaveni IP Adres pro Win
echo.
echo 1. Jsem doma (172.20.2.14/24 gw 172.20.2.1 dns 172.20.2.1)
echo 2. Jsem v klubovne (10.10.0.15/24 gw 10.10.0.1 dns 10.10.0.1)
echo 3. DHCP
echo 4. Ovis wl-1120
echo 5. Airca8-Pro
echo 6. Vlastni nastavevi
echo 7. Konec
set /p CO=:

:kontrola_akce
if %CO% leq 6 (
	goto iface
) else if %CO% equ 7 (
	goto EOF
) else (
  set /p CO=spatne, znova:
  goto kontrola_akce
)

:iface
echo.
echo Vyber nazev sitoveho pripojeni:
echo.
echo 1. lan
echo 2. wifi
echo 3. jine
echo 4. konec
set /p NUM2=:

:kontrola_ifacu
if %NUM2% equ 1 (
	set DEV=lan
) else if %NUM2% equ 2 (
	set DEV=wifi
) else if %NUM2% equ 3 (
  set /p DEV=nazev pripojeni:
) else if %NUM2% equ 4 (
  goto EOF
) else (
  set /p NUM2=spatne,znova:
  goto kontrola_ifacu
)
goto nastaveni%CO%

:nastaveni1
netsh interface ip set address %DEV% static 172.20.2.14 255.255.255.0 172.20.2.1 auto
netsh interface ip set dns %DEV% static 172.20.2.1 primary
goto EOF
:nastaveni2
netsh interface ip set address %DEV% static 10.10.0.15 255.255.255.0 10.10.0.1 auto
netsh interface ip set dns %DEV% static 10.10.0.1 primary
pause
goto EOF
:nastaveni5
netsh interface ip set address %DEV% static 192.168.1.3 255.255.255.0
goto EOF
:nastaveni4
netsh interface ip set address %DEV% static 192.168.100.250 255.255.255.0
goto EOF
:nastaveni3
netsh interface ip set address %DEV% dhcp
netsh interface ip set dns %DEV% dhcp
goto EOF
:nastaveni6
set /p IP=ip adresa:
set /p MASK=maska:
set /p GW=brana:
set /p GWM=metrika brany (pokud je vyplnena brana napis cislo nebo auto, jinak nepis nic):
set /p PRIDNS=DNS Server:
netsh interface ip set address %DEV% static %IP% %MASK% %GW% %GWM%
netsh interface ip set dns %DEV% static %PRIDNS% primary
goto EOF
:EOF

Wiki engine by dan. Content by marv.