>>
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
>?oDrive.TotalSize
>HTH
Thanks for the confirmation. Years ago I wrote a routine that uses ADIR() in a recursive routine to populate a TreeView control and show drive space usage. I'm playing around with updating it and thought I'd use the FSO if available on the user's system. I just used the above code as a first test and I was surprised it blew up. It (superficially) seems to work OK on sub-folders.
Thanks for pointing out the drive collection properties.
Still, I think the FSO shouldn't blow up in this situation.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up