修改本地连接IP地址的脚本包括修改备用dns的方法(批处理命令)

您所在的位置:网站首页 Windows命令行配置主备dns 修改本地连接IP地址的脚本包括修改备用dns的方法(批处理命令)

修改本地连接IP地址的脚本包括修改备用dns的方法(批处理命令)

2024-01-02 08:39| 来源: 网络整理| 查看: 265

=以下为我自己所用的======== title 1.bat netsh interface ip set dns “本地连接” static 10.223.253.1 primary netsh interface ip add dns “本地连接” 218.2.135.1 taskkill /FI “WINDOWTITLE eq 1.bat” /IM cmd.exe /F =以上为我自己所用的命令=========== 将以上代码保存为“修改dns批处理.bat”文件,发送到学生电脑。 然后在极域里,远程命令里选择文件夹路径为“C:\WINDOWS\system32\cmd.exe”,参数为“/k c:\修改dns批处理.bat”,如图所示: 在这里插入图片描述

以下为百度所查答案: echo off cls

title 设置IP echo 正在设置IP地址,请稍候…… netsh interface ip set address “本地连接” static 192.168.218.169 255.255.255.0 192.168.218.254 1 echo 正在更改DNS设置,请稍候…… echo 正在更改DNS设置,请稍候…… netsh interface ip set dns “本地连接” static 192.168.12.128 primary netsh interface ip add dns “本地连接” 192.168.12.129 echo 恭喜你,修改完成!

修改首选DNS、备用DNS的方法: netsh interface ip set dns “本地连接” static 192.168.12.128 primary netsh interface ip add dns “本地连接” 192.168.12.129



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3