Stops explorer.exe from being started with admin privilieges (#373)
parent
4635b44533
commit
c7005cdfcf
@ -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) <year> <copyright holders>
|
||||||
|
|
||||||
|
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.
|
@ -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 <pathToAdd>
|
||||||
|
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
|
Loading…
Reference in New Issue