네트워크 구성의 배치 파일 표시

1036 단어
네트워크 구성을 표시합니다.bat
 
  
@echo off
::  :3742668  :namejm www.cn-dos.net

:: :
call :select "ip address" "ip"
call :select "Physical Address" "mac"
call :select "Default Gateway" "gateway"
call :select "DNS Servers" "dns"
call :select "Description" "netcard"

:: 
echo IP:%ip%
echo MAC:%mac%
echo DNS:%dns%
echo GATEWAY:%gateway%
echo NETCARD:%netcard%
pause>nul
goto :eof

::**************************************************************
::               ipconfig
::**************************************************************
:select
    for /f "tokens=2 delims=:" %%i in ('ipconfig /all ^| findstr /i /c:%1') do if not "!%~2!" == "" set "%~2=%%i"
goto :eof

좋은 웹페이지 즐겨찾기