diff options
author | NoahAndrews <NoahAndrews@users.noreply.github.com> | 2016-04-11 20:30:15 +0200 |
---|---|---|
committer | NoahAndrews <NoahAndrews@users.noreply.github.com> | 2016-04-11 20:30:15 +0200 |
commit | b437de8874244711280f984c1db463937750072d (patch) | |
tree | 8f93b623b291c260f3b47202484873ea6794bb2c | |
parent | 5b86028d148f7e8b5573e4426cc67c26df82a1d4 (diff) | |
download | qmk_firmware-b437de8874244711280f984c1db463937750072d.tar.gz qmk_firmware-b437de8874244711280f984c1db463937750072d.tar.xz |
Added admin privilege check
Running this as a non-administrator appears to work at first, but the
changes wouldn't stick on my Win 8.1 system. It's weird, but this
script needs to run as admin.
-rw-r--r-- | 1-setup-path-win.bat | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat index 6965f5bb9..f612d0f4a 100644 --- a/1-setup-path-win.bat +++ b/1-setup-path-win.bat @@ -5,6 +5,13 @@ SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe SET NEWPATH1="C:\MinGW\msys\1.0\bin" SET NEWPATH2="C:\MinGW\bin" +:: Make sure we're running with administrator privileges +NET SESSION >nul 2>&1 +IF ERRORLEVEL 1 ( + ECHO FAILED. Run this script with administrator privileges. + GOTO ExitBatch +) + :: Make sure the second path exists. The first path won't be created until the second script is run IF NOT EXIST !NEWPATH2! (ECHO Path not found: %NEWPATH2% && GOTO ExitBatch) |