Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH - FSO drive enumeration: Can't make it work in VFP
Message
From
20/11/2000 19:57:50
 
 
To
20/11/2000 12:52:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00443716
Message ID:
00443921
Views:
9
>How do I do an ENUMERATE to list the current drives with FSO?
>
>
>oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>? oFSO.Drives.Count && how many drives (phys and logical)
>
>* the following example using the Item collection gives me error:
>* "Member ITEM does not evaluate to an object"
>? oFSO.Drives.Item(1).DriveLetter
>

>
>I know I must be close but it eludes me.
oFSO = CREA('Scripting.FileSystemObject')
? oFSO.Drives.Count
FOR EACH oDrive IN oFSO.Drives
   ? oDrive.DriveLetter
ENDFOR
I've never tried iterating using a number, however these are legal:

? oFSO.Drives.Item('A').IsReady
? oFSO.Drives.Item('A').DriveType

This collection won't accept a numeric argument
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