首页 > 解决方案 > DNS更改.bat脚本适用于Win7但不适用于Win10

问题描述

所以,这是代码:

:: Set primary and alternate DNS for IPv4 on Windows Server 2000/2003/2008 & 
:: Windows XP/Vista/7
@ECHO OFF
SETLOCAL EnableDelayedExpansion

netsh interface ipv4 set dns "Local Area Connection" static 8.8.8.8
netsh interface ipv4 add dns "Local Area Connection" 8.8.4.4 index=2

:EOF

当我在 Windows 7(我的台式机)上运行它时它工作正常,但它在 Windows 10(我的笔记本电脑)上不起作用。知道为什么吗?

标签: windowsbatch-file

解决方案


推荐阅读