Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need to detect a zip disk
Message
From
12/07/2002 01:19:03
 
 
To
11/07/2002 11:33:29
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00677567
Message ID:
00677863
Views:
24
>I need to detect whether a zip disk is or is not in its drive, in the server PC, in a W98 LAN. All machines in this LAN are W98.
>
>The following works only on a local machine, but fails miserably if the zip drive is on the server.
>
>o = create('scripting.filesystemobject')
> for each dc in o.drives
> ? dc.driveletter, dc.drivetype, dc.isready, dc.sharename
> next
>
>
> ? o.Drives('G').IsReady
>
>( the server PC is mapped in the "terminal" PC as G: )

I don't have a Zip drive here to test it, but maybe you could call .TotalSize or .AvailableSpace. The first should report either 100MB or 250MB, the second may "force" a call to the cartridge, which might result in a trappable error if the cartridge is not installed. Or, you could try writing a small temporary file to the disk and see if you get an error.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform