Created
January 22, 2024 01:46
-
-
Save malkia/768683a52baf41fba318535ca34877ba to your computer and use it in GitHub Desktop.
restart batch file with admin rights
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
net sessions 1>nul 2>nul || ( | |
rem Restart with admin rights the same script | |
PowerShell "Start-Process -FilePath '%0' -Verb RunAs -ArgumentList wait" | |
exit %ERRORLEVEL% | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment