Skip to content

Instantly share code, notes, and snippets.

@serialhex
Created September 20, 2024 15:28
Show Gist options
  • Save serialhex/2c33e09d232e81499d92fe26e4349f5b to your computer and use it in GitHub Desktop.
Save serialhex/2c33e09d232e81499d92fe26e4349f5b to your computer and use it in GitHub Desktop.
REM https://stackoverflow.com/a/69794302
@echo off
if "%1"=="runas" (
cd %~dp0
echo "Resetting ethernet adapter"
ipconfig /flushdns
ipconfig /registerdns
ipconfig /release
ipconfig /renew
netsh winsock reset
) else (
powershell Start -File "cmd '/K %~f0 runas'" -Verb RunAs
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment