I have a folder with subfolders and files.
I want filenames inside this folder without path and extension.
I don't want any filenames inside the subfolders (no recursivity).
for /f "tokens=*" %i in ('dir /b /a-d') do echo %~ni
to use it in a batchfile, double the percent-signs:
for /f "tokens=*" %%i in ('dir /b /a-d') do echo %%~ni