Listing files in a subfolder

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Oct 2, 2008
19
0
#1
rem ----- list subfolders
for /r /D j:\taqDAILYNBBO\ %x in (*) (

rem ----- list all files in the subfolder
for %x %y in (*) (
echo ticker= %y
)
)

This produces an error -- what am I doing wrong?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,413
40
Albuquerque, NM
prospero.unm.edu
#2
rem ----- list subfolders
for /r /D j:\taqDAILYNBBO\ %x in (*) (

rem ----- list all files in the subfolder
for %x %y in (*) (
echo ticker= %y
)
)

This produces an error -- what am I doing wrong?
I don't see how FOR %X %Y can possibly be legal syntax...

I think you're trying to do something like this:

Code:
for /r /d j:\taqDAILYNBBO\ %x in ( * ) for %y in ( %x\* ) echo ticker= %y
Which could probably be simplified to:

Code:
for /r j:\taqDAILYNBBO\ %y in ( * ) echo ticker= %y
or even reduced to a DIR or PDIR. What's the object of the game?