Question : FOREACH LOOP - DOS

The following code doesn't produce any errors, but doesn't work as I desire. What I am trying to do, is for each name in a text file, echo that name onto the screen. Here is what the text file looks like:

testname
myname
whataquestion

If I have one entry in the text file, the echo works. Any ideas?
Code Snippet:
1:
2:
3:
4:
5:
for /F %%a in (c:\temp\test.txt) do (
   
     echo %%a
 
)

Answer : FOREACH LOOP - DOS

Can you please post what result do you get by applying following command:

TYPE C:\TEMP\Test.txt

Also check what result does following script produces:

1:
2:
3:
@ECHO OFF
FOR /F %%a in ('TYPE C:\TEMP\Test.txt') DO (
	ECHO %%a)
Random Solutions  
 
programming4us programming4us