Here is the content of the directory:
λ dir /b "..\src\" main.c main.c_ main.c2 main.cpp main.cpp_ main.cpp2
This works as expected:
λ dir /b "..\src\*.c" main.c
λ dir /b "..\src\*.cpp" main.cpp main.cpp_ main.cpp2
Why does this wildcard match main.cpp_ and main.cpp2?
What is a working solution to list only *.cpp files in a directory?
EDIT: it is not a duplicate of cmd has wildcard bug?