Created
April 26, 2012 18:30
-
-
Save litodam/2501695 to your computer and use it in GitHub Desktop.
Batch CMD file starting point (with check for elevation)
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 | |
setlocal | |
CD /d "%~dp0" | |
::Test If script has Admin Privileges/is elevated | |
REG QUERY "HKU\S-1-5-19" | |
IF %ERRORLEVEL% NEQ 0 ( | |
ECHO Please run this script as an administrator | |
pause | |
EXIT /B 1 | |
) | |
cls | |
REM Do something that requires elevation here... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment