From: Maurizio on
Hi all!
I would like to create a script to read the contents of a folder.
The contents of this folder is "dynamic" in that it can change the
structure.
Do I have to read all files in all possible subfolders (may be
multiple levels).
It 'can make a script like this or should I block the creation of
subfolders to a maximum level of X?

Sorry for my bad english!!!

Thank you all!
From: Maurizio on
Solved by this script!



strFolder = "C:\test"

set objFSO = createobject("Scripting.FileSystemObject")

GetFiles strFolder

sub GetFiles(byval strDirectory)
set objFolder = objFSO.GetFolder(strDirectory)
for each objFile in objFolder.Files
wscript.echo objFile.Path
next
for each objFolder in objFolder.SubFolders
GetFiles objFolder.Path
next
end sub
From: Kenneth A. Larsen on

"Maurizio" <m.magnani(a)uniteambo.it> wrote in message
news:a82ca698-bb73-432c-b9ed-49f1213f6fed(a)q2g2000yqq.googlegroups.com...
> Hi all!
> I would like to create a script to read the contents of a folder.
> The contents of this folder is "dynamic" in that it can change the
> structure.
> Do I have to read all files in all possible subfolders (may be
> multiple levels).
> It 'can make a script like this or should I block the creation of
> subfolders to a maximum level of X?
>
> Sorry for my bad english!!!
>
> Thank you all!

Oh, that's ok because since you said ''Sorry for my bad english" I will
write posts if they aren't questions again.


From: Kenneth A. Larsen on

"Maurizio" <m.magnani(a)uniteambo.it> wrote in message
news:a82ca698-bb73-432c-b9ed-49f1213f6fed(a)q2g2000yqq.googlegroups.com...
> Hi all!
> I would like to create a script to read the contents of a folder.
> The contents of this folder is "dynamic" in that it can change the
> structure.
> Do I have to read all files in all possible subfolders (may be
> multiple levels).
> It 'can make a script like this or should I block the creation of
> subfolders to a maximum level of X?
>
> Sorry for my bad english!!!
>
> Thank you all!

OK! I forgive you!


From: Reventlov on
Il giorno Mon, 6 Sep 2010 02:22:23 -0700 (PDT), Maurizio <m.magnani(a)uniteambo.it> ha
scritto:

>Hi all!
>I would like to create a script to read the contents of a folder.
>The contents of this folder is "dynamic" in that it can change the
>structure.
>Do I have to read all files in all possible subfolders (may be
>multiple levels).
>It 'can make a script like this or should I block the creation of
>subfolders to a maximum level of X?

Dir /s/b >list.txt
works well too.

Giovanni.

--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--