Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WSH - FSO drive enumeration: Can't make it work in VFP
Message
De
20/11/2000 19:57:50
 
 
À
20/11/2000 12:52:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00443716
Message ID:
00443921
Vues:
13
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform