DonationCoder.com Software > Finished Programs
SOLVED: directory tree 'crawler'
(1/1)
Pattern-chaser:
My request is for a utility that will execute a given command in the starting directory, and also in all sub-directories in that directory. A very simple example of usage:
Crawler "C:\Code" "Dir *.c"
Will list all C source code files in C:\Code, and in all sub-directories. This example isn't even necessary, as "Dir" will do it for you, but you can see how useful it could be when you use a more meaningful command.
skwire:
http://www.cadalyst.com/management/a-very-cool-utility-cad-manager039s-toolbox-6396
Pattern-chaser:
Even better than having it written for me: a pointer to where someone already did it! Thanks Skwire!
skwire:
You're welcome. :)
capitalH:
or save a batch file with the following content
c:
cd C:\Code
for /f "tokens=*" %%d in ('dir /ad/b/s') do dir "%%d\*.c"
--- End quote ---
The first two lines is just to ensure you are in the right subdirectory
replace
dir "%%d\*.c"
with the command of your choosing (keeping the %%d though - which is each directory - try running with echo dir "%%d\*.c" to see what the actual command will be that will be run - without doing something weird to your system!)
No download, portable (windows only though) small filesize and no malware.
Navigation
[0] Message Index
Go to full version