Created
March 28, 2017 04:46
-
-
Save KiT106/244d6074139e36273200b57a57fb19c6 to your computer and use it in GitHub Desktop.
Check 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 ----[ This code block detects if the script is being running with admin PRIVILEGES If it isn't it pauses and then quits]------- | |
echo OFF | |
NET SESSION >nul 2>&1 | |
IF %ERRORLEVEL% EQU 0 ( | |
ECHO Administrator PRIVILEGES Detected! | |
) ELSE ( | |
echo ######## ######## ######## ####### ######## | |
echo ## ## ## ## ## ## ## ## ## | |
echo ## ## ## ## ## ## ## ## ## | |
echo ###### ######## ######## ## ## ######## | |
echo ## ## ## ## ## ## ## ## ## | |
echo ## ## ## ## ## ## ## ## ## | |
echo ######## ## ## ## ## ####### ## ## | |
echo. | |
echo. | |
echo ####### ERROR: ADMINISTRATOR PRIVILEGES REQUIRED ######### | |
echo This script must be run as administrator to work properly! | |
echo If you're seeing this after clicking on a start menu icon, then right click on the shortcut and select "Run As Administrator". | |
echo ########################################################## | |
echo. | |
PAUSE | |
EXIT /B 1 | |
) | |
@echo ON |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source