|
- @echo off
- title 改DNS:输入1则将4.2.2.1设为主DNS;输入2则将223.6.6.6设为主DNS。
- %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
- echo Microsoft Windows [Version 10.0.19041.207]
- echo (c) 2020 Microsoft Corporation. All rights reserved.
- echo.
- echo CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptFullName) >%Temp%\Wait.vbs
- echo wscript.sleep 1500 >>%Temp%\Wait.vbs
- start /wait %Temp%\Wait.vbs
- echo Connecting...
- echo CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptFullName) >%Temp%\Wait.vbs
- echo wscript.sleep 3000 >>%Temp%\Wait.vbs
- start /wait %Temp%\Wait.vbs
- echo.
- :home
- set /p input="[guest@107.*.*.21 ~]#^C:\Users\%username%>"
- if "%input%"=="1" goto 4
- if "%input%"=="2" goto 2
- if "%input%"=="help" goto help
- if not "%input%"=="1" if not "%input%"=="2" if not "%input%"=="help" goto ex
- :help
- echo DNS远程修改插件简介、、
- echo 》可以从服务器来连接本地,获取管理员权限并修改DNS的插件!
- echo 》本插件开源,禁止售卖!
- echo 》插件特点:自定义输入检测、自定义DNS、开源免费!
- echo 》安全易用!
- echo 》禁止用于商业用途!禁止用于违反国家法律的用途!
- goto home
- :4
- ::判断本地连接 赋值a
- for /f "tokens=3,4 delims== " %%i in ('ipconfig ^|findstr /r "以"') do echo %%i %%j >DNS.txt
- for /f "tokens=3,4 delims== " %%i in ('ipconfig ^|findstr /r "本"') do echo %%i %%j >DNS.txt
- for /f "tokens=1 delims==:" %%d in (DNS.txt) do set a=%%d
- ::dns的值
- echo 开始更改主dns
- netsh interface ip set dns name="%a%" source=static addr=4.2.2.1
- echo 完成!
- echo 开始更改副dns
- netsh interface ip add dns name="%a%" addr=223.6.6.6 index=2
- del DNS.txt
- echo 已将4.2.2.1设为 %a% 的主DNS!
- pause
- exit
- :2
- ::判断本地连接 赋值a
- for /f "tokens=3,4 delims== " %%i in ('ipconfig ^|findstr /r "以"') do echo %%i %%j >DNS.txt
- for /f "tokens=3,4 delims== " %%i in ('ipconfig ^|findstr /r "本"') do echo %%i %%j >DNS.txt
- for /f "tokens=1 delims==:" %%d in (DNS.txt) do set a=%%d
- ::dns的值
- echo 开始更改主dns
- netsh interface ip set dns name="%a%" source=static addr=223.6.6.6
- echo 完成!
- echo 开始更改副dns
- netsh interface ip add dns name="%a%" addr=4.2.2.1 index=2
- del DNS.txt
- echo 已成功将233.6.6.6设为 %a% 的主DNS!
- pause
- exit
- :ex
- echo '%input%' is not recognized as an internal or external command,
- echo operable program or batch file.
- goto home
复制代码 快速修改DNS:将代码复制,然后新建一个文件,后缀改为bat,运行即可
|
|