Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dir
Message
De
13/11/2002 05:09:35
 
 
À
13/11/2002 05:00:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Dir
Divers
Thread ID:
00722009
Message ID:
00722010
Vues:
24
>Is there a way of getting the size of subdirectories
>
>I tried
>
>Run dir x:\foxdev\* /s >x:\temp\dirsize.txt
>
>but this will not work from within foxpro
>
>any Ideas please


Try using the WSH Scripting.FileSystemObject; you can rerieve a Folder object using GetFolder and then step through the SubFolders collection to retrieve their sizes:
oFSO = CREATEOBJ('Scripting.FileSystemObject')
oFolder=oFSO.GetFolder('C:\MyFolderWithSubFolders')
FOR EACH oSubFolder IN oFolder
   ? oSubFolder.Name, oSubFolder.Size
ENDFOR
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform