-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.bat
27 lines (23 loc) · 841 Bytes
/
setup.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@echo off
if not "%1" == "/f" (
:: Check if path contains batchrc already.
echo."%path%" | findstr /c:"batchrc">nul && (
echo ERROR: Batchrc was already setup! Please remove batchrc from your machine path variable before running again.
echo Use /f to ignore this error message.
goto:eof
)
if not "%BRC_PATH%" == "" (
echo ERR: Batchrc was already setup! Please remove BRC_PATH environment variable before running again.
echo Use /f to ignore this error message.
goto:eof
)
)
:: Grab the directory where this script is.
set brc_path=%~dp0
:: Updates system path variable with BRC path.
set clone=%PATH%
setx path /m ""
set PATH=%clone%;%brc_path%
setx path /m "%clone%;%brc_path%
:: Create machine variable with BRC path for later reference.
setx BRC_PATH %brc_path% /m