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

  • #90088192

    törölt tag

    válasz UnA #12 üzenetére

    :DDD Nem is vettem eszre, de maris javítom.
    Köszönöm Mester :R

    ECHO OFF
    SET adaptername=LAN
    TITLE %adaptername% SETTINGS
    CLS
    :MENU
    ECHO.
    ECHO .................................................................................
    ECHO ......These Settings will be applied on the Network Connection which named %adaptername%.
    ECHO ......Please rename the designated Network Connection to %adaptername%!
    ECHO ......Plug the network cable in both ends, and make sure the Adapter(%adaptername%) is connected.
    ECHO ......With Option 5 please check connection before select any other 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 %adaptername%
    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
    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

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