Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FSO OLE Error Code
Message
De
17/12/2001 15:26:59
 
 
À
17/12/2001 14:58:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00595266
Message ID:
00595330
Vues:
26
>>>>>
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>>>>>oFolder = oFSO.GetFolder("C:\")
>>>>>?oFolder.Size
>>>>>When I run this code from the Command Window, the .Size grinds away on my HD for about 12 seconds (which is as expected, it's scanning all folders/files) then craps out with
>>>>>
>>>>>OLE error code 0x800a0046: Unknown COM status code.
>>>>>
>>>>>I'd like to find out if it's limited to my system or if others get it too.
>>>>>
>>>>>My environment:
>>>>>W2K SP2 + all critical updates and security patches - logged in as Administrator
>>>>>IE6 6.0.2600.0000 with all security patches
>>>>>VFP7 build 9262 with available patches
>>>>
>>>>I get the same error too (on W2K). If you want to get the drive's size, you can also do this:
>>>>
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>>>>oDrive = oFSO.GetDrive("C:\")
>>>>?oDrive.AvailableSpace && or
>>>>?oDrive.TotalSize
>>>>HTH
>>>
>>>That would be totalsize for hard disk space.
>>
>>oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>>oDrive = oFSO.GetDrive("D:\")
>>?oDrive.AvailableSpace && or
>>?oDrive.TotalSize
>>?oDrive.FreeSpace
>>
>>Doesn't work correctly on my D drive. It returns 2147155968 for all properties.
>
>Does this drive have any files? AvailableSpace and FreeSpace are supposed to be the same, but not TotalSize.

No, it's running Win9x, and cast the return value as an Integer; the value returned is the largest available integer in a VFP integer value (2^31-1). It's a problem related to how Win9x interprets the data type; NT and NT derivatives will use a real rather than an integer, and will return the correct size. I thought this was corrected in WSH 2.1 or 5.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform