手机
当前位置:查字典教程网 >脚本专栏 >DOS/BAT >使用批处理命令设置windows系统的ip地址和dns附图
使用批处理命令设置windows系统的ip地址和dns附图
摘要:找到对应的网卡名称使用命令:ipconfig复制代码代码如下:ipconfig/allWindowsIPConfigurationHostN...

找到对应的网卡名称

使用命令:ipconfig

复制代码 代码如下:

ipconfig/all

Windows IP Configuration

Host Name . . . . . . . . . . . . : D501-4-3

Primary Dns Suffix . . . . . . . :

Node Type . . . . . . . . . . . . : Unknown

IP Routing Enabled. . . . . . . . : No

WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter 本地连接:

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . : Marvell Yukon 88E8057 PCI-E Gigabit

Ethernet Controller

Physical Address. . . . . . . . . : 44-37-E6-1D-5B-F1

Dhcp Enabled. . . . . . . . . . . : No

IP Address. . . . . . . . . . . . : 192.168.1.111

Subnet Mask . . . . . . . . . . . : 255.255.255.0

Default Gateway . . . . . . . . . : 192.168.1.1

DNS Servers . . . . . . . . . . . : 8.8.8.8

我们现在需要设置的网卡名称为"本地连接",ip地址为192.168.1.111,子网掩码为255.255.255.0,dns地址为8.8.8.8

将ip和dns设置为自动获取

使用命令:

netsh interface ip set address "本地连接" dhcp

netsh interface ip set dns "本地连接" dhcp

复制代码 代码如下:

netsh interface ip set address "本地连接" dhcp

确定。

netsh interface ip set dns "本地连接" dhcp

确定。

相当于操作:

1

将ip和dns设置为固定的值

使用命令:

netsh interface ip set address "本地连接" static [ip地址] [子网掩码] [网关] [网关跳远点数:一般填1]

netsh interface ip set dns "本地连接" static [dns地址]

复制代码 代码如下:

netsh interface ip set address "本地连接" static 192.168.1.111 255.255.255.0 192

.168.1.1 1

确定。

netsh interface ip set dns "本地连接" static 8.8.8.8

确定。

相当于操作:

2

【使用批处理命令设置windows系统的ip地址和dns附图】相关文章:

使用批处理删除文件夹时遇到的问题

DOS批处理高级教程 第三章 FOR命令中的变量

用批处理设置IP安全策略的代码

使用批处理删除HOSTS中特定内容的行的代码

编程用到的windows系统目录变量简写

用DOS批处理实现建立文件夹的代码

用批处理制作超大文件

用批处理写的永不被杀的后门

用批处理写的后门 永不被杀

用批处理实现读取文本文件并实现超链接代码的输出 原创

精品推荐
分类导航