Skip to content

Instantly share code, notes, and snippets.

@lxfly2000
Created June 24, 2019 09:45
Show Gist options
  • Save lxfly2000/9c4d716ebd7d78b05b4fa0382d73f418 to your computer and use it in GitHub Desktop.
Save lxfly2000/9c4d716ebd7d78b05b4fa0382d73f418 to your computer and use it in GitHub Desktop.
Configure DNS by using cmdline.
@echo off
netsh interface ipv6 set dnsservers WLAN dhcp
if %errorlevel%==0 goto:eof
echo 这个操作需要管理员权限……
mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~0 %*","%cd%","runas",1)(close)
@echo off
netsh interface ipv6 set dnsservers WLAN static 2001:470:20::2 primary
netsh interface ipv6 add dnsservers WLAN 2001:470:0:9d::2
if %errorlevel%==0 goto:eof
echo 这个操作需要管理员权限……
mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~0 %*","%cd%","runas",1)(close)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment