码迷,mamicode.com
首页 > 其他好文 > 详细

bat批处理设置静态、动态、ping、查看网络配置

时间:2017-03-30 17:03:49      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:查看   log   网络   ipc   mask   rem   exit   ping   static   

@echo off
:startIP
set /p source=S or D or C or P or E:
echo source:%source%
if /i "%source%" == "S" ( goto staticIP )
if /i "%source%" == "D" ( goto dhcpIP )
if /i "%source%" == "C" ( goto ipconfig )
if /i "%source%" == "P" ( goto ping )
if /i "%source%" == "e" ( goto exitSet )
:staticIP
set /p IP=IP:
netsh interface ip set address name="本地连接" source=static addr=%IP% mask=255.255.255.0 gateway=192.168.10.1
goto startIP
:dhcpIP
netsh interface ip set address name="本地连接" source=dhcp
goto startIP
:ipconfig
ipconfig
goto startIP
:ping
set /p TARGET=TARGET:
ping %target%
goto startIP
:exitSet
exit
@Rem @netsh interface ip set dns name="本地连接" source=static addr=192.168.10.1

啦啦啦

bat批处理设置静态、动态、ping、查看网络配置

标签:查看   log   网络   ipc   mask   rem   exit   ping   static   

原文地址:http://www.cnblogs.com/ClassNotFoundException/p/6646894.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!