From c7005cdfcf4e4a3fc4abd536afd9fb9a378994fb Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Thu, 2 Jun 2016 13:00:44 -0400 Subject: Stops explorer.exe from being started with admin privilieges (#373) --- util/ELEVATE_LICENSE.md | 25 +++++++++++++++++++++++++ util/add-paths.bat | 30 ++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 util/ELEVATE_LICENSE.md create mode 100644 util/add-paths.bat (limited to 'util') diff --git a/util/ELEVATE_LICENSE.md b/util/ELEVATE_LICENSE.md new file mode 100644 index 000000000..1cf4fda91 --- /dev/null +++ b/util/ELEVATE_LICENSE.md @@ -0,0 +1,25 @@ +Elevate was downloaded from [here](https://jpassing.com/2007/12/08/launch-elevated-processes-from-the-command-line/). + +### LICENSE + +The MIT License (MIT) + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. \ No newline at end of file diff --git a/util/add-paths.bat b/util/add-paths.bat new file mode 100644 index 000000000..ab3d91da1 --- /dev/null +++ b/util/add-paths.bat @@ -0,0 +1,30 @@ +@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +@ECHO off + +SET NEWPATH1="C:\MinGW\msys\1.0\bin" +SET NEWPATH2="C:\MinGW\bin" + +CD %~dp0 + +ECHO. > add-paths.log + +CALL :AddPath %NEWPATH1% +CALL :AddPath %NEWPATH2% + +EXIT /b + +:AddPath +ECHO %PATH% | FINDSTR /C:"%~1" > nul +IF ERRORLEVEL 1 ( + REG add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v PATH /t REG_SZ /d "%PATH%;%~1" >> add-paths-detail.log + IF ERRORLEVEL 0 ( + ECHO Adding %1 . . . Success! >> add-paths.log + SET "PATH=%PATH%;%~1" + COPY NUL UPDATE + ) ELSE ( + ECHO Adding %1 . . . FAILED. Run this script with administrator privileges. >> add-paths.log + ) +) ELSE ( + ECHO Skipping %1 - Already in PATH >> add-paths.log + ) +EXIT /b \ No newline at end of file -- cgit v1.2.3