Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the batch file that displays the network configuration

Shulou Source: shulou.com Published: 2022-06-03 08:16:34 11月15日 Update

This article mainly introduces how to display the network configuration of the batch file, the article is very detailed, has a certain reference value, interested friends must read it!

Displays the network configuration .bat

The code is as follows:

@ echo off:: code writing: 3742668 Code revision: namejm www.cn-dos.net:: call format: call: select "ip address"ip" call: select "Physical Address"mac" call: select "Default Gateway"gateway" call: select "DNS Servers"dns" call: select "Description"netcard": demonstration effect echo IP:%ip% echo MAC:%mac% echo DNS:%dns% echo GATEWAY:%gateway% echo NETCARD :% netcard% pause > nul goto: eof:: *:: parse the ipconfig command output general function:: * * *: select for / f "tokens=2 delims=:"% I in ('ipconfig / all ^ | findstr / I / all% 1') do if not "!% ~ 2!" = "" set "% ~ 2%% I" goto: eof is all the contents of the article "how to display the batch file of network configuration" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Network configuration code files content articles values interests functions commands guys partners effects more formats knowledge industry information information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux NVidia Shulou Information macOS Microsoft