I have a problem with my batch code. I want to use substring for file name and add this string to another. When I use substring inside For loop my substring doesn't work. Variable str is empty. Could anybody help my? screen and code you can find below.
echo on
set Subj="Docs nr "
D:
CD "\ANTEEO\INTEGRATION\BMHOUSING\out"
for /R %%x in (*.csv) do (
CD "D:\ANTEEO\INTEGRATION\BMHOUSING\"
set str=%%~nx
echo.%str%
set str=%str:~0,10%
echo.%str%
set Subj=!%Subj%%str%!
echo.%Subj%
)