[thelist] Old School DOS tricks
Joshua Olson
joshua at alphashop.net
Mon Dec 10 23:10:15 CST 2001
Ok, now that we've got the trick, what can we do with it.
Well, here's one good use.
Let's say you want an entire folder structure pasted into a text file so
that you can read it in and push it into a db if you have the need.
Try this:
dir /b/s/l/aa>files.txt
dir /b/l/s/ad>directories.txt
This will make two text files. The first will contain every file in the HD
starting at a certain point. The second will contain every directory on the
HD starting at a certain point.
A sample couple of lines from the files.txt looks like this:
d:\inetpub\filename.exe
d:\inetpub\filename2.com
etc...
A sample from the directories.txt looks like this:
d:\inetpub\directory1
d:\inetpub\directory2
etc...
IOW, no crap to parse out! No need to write recursive functions. Just
execute the DOS lines, and then read in the file.
Have fun.
-joshua
More information about the thelist
mailing list