Page 1 of 1

A small DOS query

Posted: Sat Dec 07, 2013 4:32 am
by Blasturbator
If i were using the FOR command in DOS where

Code: Select all

FOR [drive:\][directory] %variable IN (set) DO command [command-parameters]
What would i put in (set) to make it use folders? (directories if you want to be picky :P)

Currently I'm doing

Code: Select all

for %%b in (*.partsbnd) do
And this does all files with the format .partsbnd, how would i go about making that set apply to whole folders as opposed to specific file type sets.

Re: A small DOS query

Posted: Thu Dec 19, 2013 3:05 pm
by Sir Kane
FOR /F "tokens=*" %%G IN ('dir /B /S /A-D') DO whatever.exe "%%G"
Where the /S option means recursive, and /A-D makes it not pass dir names to whatever.exe.

Re: A small DOS query

Posted: Thu Dec 19, 2013 7:48 pm
by Darkstar
I wonder what this has to do with DOS, DOS didn't have that feature in its FOR implementation...