I want that my batch script only shows the filename without any path or extension in a specific directory of *.exe files. My code so far is this:
for /R "%cd%" %%e in (*.exe) do (
set "EXENAME=%%~ne"
echo "%EXENAME%"
)
But this code does not work as expected. Let's assume, I have two files in that directory: tomcat7.exe
and tomcat7w.exe
. But when processing the script, I get as an answer this:
"tomcat7w"
"tomcat7w"
Why is that?