浏览文章
文章信息
Win10 bat批处理文件设置静态ip和设置自动获取ip
1249
不修改可以直接到底部下载脚本。
1、开启代理(静态IP)脚本
@echo off %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit set regpath="HKEY_CURRENT_USER\Console\%%SystemRoot%%_system32_cmd.exe" REG QUERY %regpath% /s|find "CodePage" if not %errorlevel% leq 0 ( REG ADD HKEY_CURRENT_USER\Console\%%SystemRoot%%_system32_cmd.exe /v CodePage /t REG_SZ /d dword:0000fde9 /f echo CMD注册表安装完成 ) else ( echo CMD注册表存在:已跳过安装 ) echo 正在设置您的IP地址,请稍等…… echo Weline修改IP地址工具 netsh interface ip set address name="以太网" gateway=192.168.121.100 gwmetric=0 source=static addr=192.168.121.216 mask=255.255.255.0 netsh interface ip set dns name="以太网" source=static addr=192.168.121.100 register=primary netsh interface ip add dns name="以太网" addr=192.168.121.100 netsh interface ip set wins name="以太网" source=static addr=none2、关闭代理(自动获取IP)脚本
@echo off %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit echo Weline修改IP地址工具 echo 正在设置自动获得IP地址,请稍等…… netsh interface ip set address name="以太网" source=dhcp netsh interface ip set dns name="以太网" source=dhcp
如需要其他功能自行修改