Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WSH and Subfolders of Subfolders
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
WSH and Subfolders of Subfolders
Divers
Thread ID:
00224547
Message ID:
00224547
Vues:
66
Hi all,

I've been experimenting with the FileSystemObject and so far have really liked using it. I am attempting to get a list of filenames contained in certain folders, including subfolders that are several levels deep from the root folder. The code below works okay for getting the first level of files, but what modifications do I need to make to get ALL files contained on a particular drive/folder, including any files nested within multiple layers of subfilders? Any help is appreciated.

The following code is a sample of what I'm working with so far (In my actual code, I am storing the filename and its complete path in a table rather than using a wait window to display it to the screen!):

oFileSystem=CREATEOBJECT("scripting.filesystemobject")
IF oFileSystem.FolderExists('C:\')
oFolder=oFileSystem.GetFolder('C:\')
FOR EACH oSubFolder in oFolder.SubFolders
FOR EACH oFile in oSubFolder.Files
WAIT WINDOW oFile.Name TIMEOUT 1
ENDFOR
ENDFOR
ENDIF

Thanks,
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform