Skip to content

Instantly share code, notes, and snippets.

@celeron633
Created March 16, 2023 13:16
Show Gist options
  • Save celeron633/69b9a5616ca0f50d83d67e5aa05eb55d to your computer and use it in GitHub Desktop.
Save celeron633/69b9a5616ca0f50d83d67e5aa05eb55d to your computer and use it in GitHub Desktop.
windows cmd切换网络配置
echo off
@echo off&(cd/d "%~dp0")&(cacls "%SystemDrive%\System Volume Information" >nul 2>&1)||(color 4f&echo 请右键“以管理员身份运行”&echo.&pause&exit /b)
netsh interface ip set address "以太网" static 192.168.31.100 255.255.255.0 192.168.31.3 1
netsh interface ip set dns "以太网" static 8.8.8.8
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment