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" (
10
10
call :%*
11
11
)
12
12
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
+
13
20
exit /b
14
21
15
22
:enhance_path
@@ -50,7 +57,7 @@ exit /b
50
57
set " position = "
51
58
)
52
59
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
54
61
55
62
if " %ERRORLEVEL% " == " 0" (
56
63
set " add_to_path = %add_path% "
@@ -184,7 +191,7 @@ exit /b
184
191
set " position = "
185
192
)
186
193
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
188
195
189
196
if " %ERRORLEVEL% " == " 0" (
190
197
set " add_to_path = %add_path% "
You can’t perform that action at this time.
0 commit comments