Guest User

Untitled

a guest
Feb 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. @ECHO off
  2. :: Stupid batch script to restart eth interface
  3. :: I was annoyed with enabling and disabling it from control panel or cmd so i "code" this shit.
  4. :: How to
  5. :: - Change, in NETSH command interface name with yours, mine is Ethernet,
  6. :: - If you dont know whats your interface name, run "netsh interface show interface" in cmd as admin
  7. :: Enjoy. - cttynul
  8.  
  9. GOTO CHECKADMIN
  10.  
  11. :CORE
  12. netsh interface set interface "Ethernet" admin=disable
  13. netsh interface set interface "Ethernet" admin=enable
  14. ECHO Success!
  15. PAUSE
  16. GOTO EOF
  17.  
  18. :CHECKADMIN
  19. NET SESSION >nul 2>&1
  20. IF %ERRORLEVEL% == 0 (
  21. ECHO.
  22. ECHO Admin permissions confirmed.
  23. GOTO CORE
  24. ) ELSE (
  25. ECHO Failure: Current permissions inadequate.
  26. ECHO This script needs to be run as admin. Right click - Run as Admin.
  27. PAUSE
  28. GOTO EOF
  29. )
Add Comment
Please, Sign In to add comment