Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dir
Message
From
13/11/2002 05:15:44
 
 
To
13/11/2002 05:00:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Dir
Miscellaneous
Thread ID:
00722009
Message ID:
00722015
Views:
13
>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

Sorry - I hit tab when I should have hit return the fiorst time. The example below is corrected.

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')
IF oFolder.SubFolders.Count > 0
FOR EACH oSubFolder IN oFolder.SubFolders
? oSubFolder.Name, oSubFolder.Size
ENDFOR
ENDIF
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
Previous
Reply
Map
View

Click here to load this message in the networking platform