File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ if "%~1" == "/h" (
1010 call :%*
1111)
1212
13+ setlocal enabledelayedexpansion
14+ if not defined find_pathext (
15+ set " find_pathext = !PATHEXT:; = ! "
16+ set " find_pathext = !find_pathext:. =\. ! "
17+ )
18+ endlocal & set " find_pathext = %find_pathext% "
19+
1320exit /b
1421
1522:enhance_path
@@ -50,7 +57,7 @@ exit /b
5057 set " position = "
5158 )
5259
53- dir " %add_path% " 2 > NUL | findstr -i " \.COM \.EXE \.BAT \.CMD \.PS1 \.VBS " > NUL
60+ dir " %add_path% " 2 > NUL | findstr -i -e " %find_pathext% " > NUL
5461
5562 if " %ERRORLEVEL% " == " 0" (
5663 set " add_to_path = %add_path% "
@@ -184,7 +191,7 @@ exit /b
184191 set " position = "
185192 )
186193
187- dir " %add_path% " 2 > NUL | findstr -i " \.COM \.EXE \.BAT \.CMD \.PS1 \.VBS " > NUL
194+ dir " %add_path% " 2 > NUL | findstr -i -e " %find_pathext% " > NUL
188195
189196 if " %ERRORLEVEL% " == " 0" (
190197 set " add_to_path = %add_path% "
You can’t perform that action at this time.
0 commit comments