Created
June 22, 2020 17:57
-
-
Save Terrabits/2cd5f423e56a81867e6be36c7f01895c to your computer and use it in GitHub Desktop.
asserts that the current environment includes administrator privileges
This file contains 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 Batch script: how to check for admin rights | |
rem https://stackoverflow.com/a/11995662/1390788 | |
net session >nul 2>&1 | |
if not %ErrorLevel% == 0 ( | |
echo "ERROR: no administrative priviliges" | |
exit /b 1 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment