Important information: this site is currently scheduled to go offline indefinitely by end of the year.

A small DOS query

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
Blasturbator
ultra-n00b
Posts: 2
Joined: Thu Dec 05, 2013 9:12 pm

A small DOS query

Post 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.
Sir Kane
veteran
Posts: 104
Joined: Mon Aug 06, 2012 4:14 am
Been thanked: 96 times

Re: A small DOS query

Post 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.
Darkstar
advanced
Posts: 67
Joined: Thu Jun 14, 2007 1:14 pm
Location: Southern Germany
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: A small DOS query

Post by Darkstar »

I wonder what this has to do with DOS, DOS didn't have that feature in its FOR implementation...
Check out the REWiki!
Post Reply