Advertisement
shchuko

script22.cmd

Feb 18th, 2020
1,667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3. set /p ANSWER="Set mode (Auto/Manual): "
  4. if %ANSWER% == Auto (
  5.     netsh interface ip set address "Ethernet" dhcp
  6.     netsh interface ip set dns "Ethernet" dhcp
  7. ) else if %ANSWER% == Manual (
  8.     netsh interface ip set address "Ethernet" static 192.168.1.10 255.255.255.0 192.168.1.1
  9.     netsh interface ip set dns "Ethernet" static 8.8.8.8
  10. ) else (
  11.     echo Wrong input!
  12.     pause
  13.     exit /b
  14. )
  15.  
  16. netsh interface ip show address
  17. netsh interface ip show dns
  18. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement