prevent warnings if the dir does not exist

https://github.com/cmderdev/cmder/issues/121#issuecomment-654171568
This commit is contained in:
David Refoua 2024-11-13 23:08:13 +03:30
parent 42315d8cec
commit 25ccfeed77

View File

@ -52,7 +52,7 @@ exit /b
set "position="
)
dir "%add_path%" | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL
dir "%add_path%" 2>NUL | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL
if "%ERRORLEVEL%" == "0" (
set "add_to_path=%add_path%"
) else (