Go through the subdirectories by GetFileList

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Josep
Newbie
Posts: 1
Joined: Thu May 08, 2003 10:03 pm

Go through the subdirectories by GetFileList

Post by Josep » Thu May 08, 2003 10:09 pm

Hi all:
With GetFileList I can only take Files from one several folder.
Some body knows how can I read files from one folder until the last subfolder it has?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri May 09, 2003 12:33 am

Older versions of DOS used to have a command named TREE that would do that. If you can find that it may work. If you can't find it, or it doesn't work in your OS, you can use DIR and redirect the output to a file.

This will give you the entire contents for Drive C:
Change Directory>C:\
Run Program>command.com /c dir *.* /s >c:\treelist.txt

Or you can change to a lower level directory instead of changing to the root. and the destination filename is one of your choice also.

(You may have to use cmd vs. command depending on your OS).

You can also use the sorting parameters /ox where "x" varies on the sorting you want. At a command prompt, type DIR /? to see the syntax and options.

You can also use the FIND command with DIR and the pipe "|" to further filter out the results before it is redirected to your treelist.txt file.

Try out some variations in Command window before you create your script. See the results on the screen vs. redirecting to a file.

Hope this helps, good luck.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Fri May 09, 2003 2:13 pm

If that filelist should be the source to do some filehandling afterwards, you should have a look at xcopy as well.

OS --> command to run on the commandline:

WIN 9x/ME --> command /k xcopy /?
W2K/NT/XP--> cmd /k xcopy /?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts