This commit is contained in:
David Refoua 2024-11-14 00:01:29 +03:30
parent 7ceacb63dd
commit 126347025f

View File

@ -87,20 +87,20 @@ exit /b
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!;"
call :set_found
)
%print_debug% :enhance_path "Env Var INSIDE PATH !find_query! - found=!found!"
%print_debug% :enhance_path "Env Var INSIDE PATH !find_query! - found=!found!"
if /i "!position!" == "append" (
if "!found!" == "0" (
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$"
call :set_found
)
%print_debug% :enhance_path "Env Var END PATH !find_query! - found=!found!"
%print_debug% :enhance_path "Env Var END PATH !find_query! - found=!found!"
) else (
if "!found!" == "0" (
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;"
call :set_found
)
%print_debug% :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!"
%print_debug% :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!"
)
endlocal & set found=%found%
@ -135,8 +135,8 @@ exit /b
exit /b
:changed
%print_debug% :enhance_path "END Env Var - PATH=%path%"
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
%print_debug% :enhance_path "END Env Var - PATH=%path%"
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
exit /b
exit /b
@ -210,10 +210,10 @@ exit /b
exit /b
)
%print_debug% :enhance_path_recursive "Env Var - add_path=%add_to_path%"
%print_debug% :enhance_path_recursive "Env Var - position=%position%"
%print_debug% :enhance_path_recursive "Env Var - depth=%depth%"
%print_debug% :enhance_path_recursive "Env Var - max_depth=%max_depth%"
%print_debug% :enhance_path_recursive "Env Var - add_path=%add_to_path%"
%print_debug% :enhance_path_recursive "Env Var - position=%position%"
%print_debug% :enhance_path_recursive "Env Var - depth=%depth%"
%print_debug% :enhance_path_recursive "Env Var - max_depth=%max_depth%"
if %max_depth% gtr %depth% (
if "%add_to_path%" neq "" (
@ -238,9 +238,9 @@ exit /b
)
for /d %%i in ("%add_path%\*") do (
%print_debug% :enhance_path_recursive "Env Var BEFORE - depth=%depth%"
%print_debug% :enhance_path_recursive "Env Var BEFORE - depth=%depth%"
%print_debug% :enhance_path_recursive "Found Subdirectory - '%%~fi'"
call :enhance_path_recursive "%%~fi" %depth% %max_depth% %position%
%print_debug% :enhance_path_recursive "Env Var AFTER- depth=%depth%"
%print_debug% :enhance_path_recursive "Env Var AFTER- depth=%depth%"
)
exit /b