]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/1-setup-path-win.bat
[Keymap] Add missing tap dance action and fix RGB hues in personal keymaps (#6312)
[qmk_firmware.git] / util / 1-setup-path-win.bat
1 @SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
2 @ECHO OFF
3 SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe
4
5 DEL script1.log > NUL 2>&1
6 DEL add-paths.log > NUL 2>&1
7 DEL add-paths-detail.log > NUL 2>&1
8 DEL UPDATE > NUL 2>&1
9
10 ELEVATE -wait add-paths.bat >> script1.log 2>&1
11
12 IF ERRORLEVEL 1 (
13         ECHO You denied admin access. Rerun the script, and be sure to press the yes button this time.
14 ) ELSE (
15         TYPE add-paths.log 2> NUL
16 )
17 ECHO.
18
19 :: Branch to UpdateEnv if we need to update
20 IF EXIST UPDATE (
21         DEL UPDATE
22         GOTO UpdateEnv
23 )
24
25 GOTO ExitBatch
26
27 :: -----------------------------------------------------------------------------
28
29 :UpdateEnv
30 ECHO Making updated PATH go live . . .
31 REG delete HKCU\Environment /F /V TEMPVAR > NUL 2>&1
32 setx TEMPVAR 1 > NUL
33 REG delete HKCU\Environment /F /V TEMPVAR > NUL 2>&1
34 IF NOT !cmdcmdline! == !CMDLINERUNSTR! (CALL :KillExplorer)
35 GOTO ExitBatch
36
37 :: -----------------------------------------------------------------------------
38
39 :ExitBatch
40 ENDLOCAL
41 PAUSE
42 EXIT /b
43
44 :: -----------------------------------------------------------------------------
45
46 :KillExplorer
47 ECHO.
48 ECHO.
49 ECHO Your desktop will be restarted. 
50 ECHO.
51 ECHO All file explorer windows except for the one you launched this script from WILL BE CLOSED.
52 ECHO.
53 ECHO Press enter when ready, or close this window if you would rather do a full restart of your computer at a later time.
54 ECHO.
55 PAUSE
56 ping -n 5 127.0.0.1 > NUL 2>&1
57 ECHO Killing process Explorer.exe. . . 
58 ECHO.  
59 taskkill /f /im explorer.exe > NUL
60 ECHO.   
61 ECHO Your desktop is now loading. . . 
62 ECHO.   
63 ping -n 5 127.0.0.1 > NUL 2>&1
64 START explorer.exe
65 START explorer.exe %CD%
66 EXIT /b