Here is my batch file :
@echo off
cd "D:/myFiles"
for /r %%filename in (*) do (
set f=%%filename
echo %f%
)
pause
What I m expecting is,it will list all the files in myFiles directory.
But what I am getting is 'Echo is Off' for the same number of times as the number of files in directory 'myFiles'.
With
echo %%filename
I can list filename but I have to do some more operation on filename and so to have to store it in a variable like as currently its stored in variable f.
Any help will be appreciated.
delayed expansionas this is a question that is asked regularly.