批处理修改Windows的IP地址

来源:互联网 发布:淘宝客服有在家做的吗 编辑:程序博客网 时间:2024/05/21 06:48

设置固定IP

@echo off%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exitcd /d "%~dp0"netsh interface ip set address "以太网" static 10.10.4.195 255.255.255.0 10.10.4.254netsh interface ip set dns "以太网" static 202.96.209.133netsh interface ip add dns "以太网" 202.96.209.5




设置动态获取

@echo off%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exitcd /d "%~dp0"netsh interface ip set address "以太网" dhcpnetsh interface ip set dns "以太网" dhcp


原创粉丝点击