Last active
June 7, 2021 12:35
-
-
Save asheroto/9a1315db552d7f801bc80cc0a83e8ee2 to your computer and use it in GitHub Desktop.
Confirms if you are running the BAT/CMD script as administrator and prompts you to do so if not.
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
@echo off | |
:: Confirm running as administrator | |
fltmc >nul 2>&1 || ( | |
echo This batch script requires administrator privileges. Right-click on | |
echo the script and select "Run as Administrator". | |
goto :die | |
) | |
:: Your code starts here | |
:: Your code ends here | |
:die | |
echo. | |
pause | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment