Created
September 20, 2024 15:28
-
-
Save serialhex/2c33e09d232e81499d92fe26e4349f5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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