Új hozzászólás Aktív témák

  • #90088192

    törölt tag

    válasz Gargouille #10 üzenetére

    Beszúrom ide a végleges verziót ha valakit érdekel a jövőben, es köszönöm a segítséget még egyszer:
    ECHO OFF
    TITLE LAN SETTINGS
    set adaptername=LAN
    CLS
    :MENU
    ECHO.
    ECHO .................................................................................
    ECHO ......These Settings will be applied on the Network Connection
    ECHO ......which named LAN. Please rename the designated Network Connection to LAN!
    ECHO ......Plug the network cable in both ends, and make sure the
    ECHO ......the Adapter(LAN) is connected before select any of the options!
    REM ECHO
    ECHO ......PRESS 1, 2, 3, 4 OR 5 to select your task, or 6 to EXIT.
    ECHO .................................................................................
    ECHO.
    ECHO 1 - Set Static IP 192.168.1.200 (SUBNET MASK:255.255.255.0; Gateway:192.168.1.1)
    ECHO 2 - Enter a Static IP (SUBNET MASK:255.255.255.0; Gateway:192.168.1.1)
    ECHO 3 - Manual IP Address, Subnet Mask and Gateway Address Setup
    ECHO 4 - Automatic Address and DHCP Setting
    ECHO 5 - IP CONFIG information on LAN
    ECHO 6 - Exit
    ECHO.
    CHOICE /C:123456
    IF ERRORLEVEL 1 SET M=1
    IF ERRORLEVEL 2 SET M=2
    IF ERRORLEVEL 3 SET M=3
    IF ERRORLEVEL 4 SET M=4
    IF ERRORLEVEL 5 SET M=5
    IF ERRORLEVEL 6 SET M=6
    IF %M%==1 GOTO STATIC
    IF %M%==2 GOTO STATIC_MANUAL
    IF %M%==3 GOTO MANUAL
    IF %M%==4 GOTO AUTO
    IF %M%==5 GOTO IP_CONFIG
    IF %M%==6 GOTO EOF
    :STATIC
    netsh interface ipv4 set address name="%adaptername%" static 192.168.1.200 255.255.255.0 192.168.1.1
    CLS
    GOTO MENU
    :STATIC_MANUAL
    SET /P A=Type IP Address in then press ENTER:
    netsh interface ipv4 set address name="%adaptername%" static %A% 255.255.255.0 192.168.1.1
    CLS
    GOTO MENU
    :MANUAL
    SET /P IP_ADDRESS=Type IP Address in then press ENTER:
    SET /P SUBNET_MASK=Type Subnet Mask Address in then press ENTER:
    SET /P GATEWAY=Type Gateway Address in then press ENTER:
    netsh interface ipv4 set address name="%adaptername%" static %IP_ADDRESS% %SUBNET_MASK% %GATEWAY%
    CLS
    GOTO MENU
    :AUTO
    ipconfig /release "%adaptername%"
    netsh interface ipv4 set address name="%adaptername%" dhcp
    CLS
    GOTO MENU
    :IP_CONFIG
    CLS
    @echo off
    setlocal enabledelayedexpansion
    set lineprint=0
    for /f "tokens=*" %%l in ('ipconfig /all') do (
    echo %%l | findstr "adapter" > nul
    if not errorlevel 1 (
    echo %%l | findstr /c:"%adaptername%:" > nul
    if errorlevel 1 (set lineprint=0) else (set lineprint=1)
    )
    if !lineprint! == 1 echo %%l
    )
    GOTO MENU

    [ Szerkesztve ]

Új hozzászólás Aktív témák