Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for Existance of Diskette in Drive A
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00419785
Message ID:
00420084
Vues:
33
>I did not know that. I used this code with an old app that ran on a win95 box. So, if NUL is not a valid device in NT, do you know what will work to check for the existence of a diskette in drive A?
>

You can use Scripting.FileSystemObject; the following works without requiring an API call that will alter the reporting of system errors by WinNT or Win2K:

oFSO=CREATEOBJ('Scripting.FileSystemObject')
? oFSO.Drives.Item('A:').IsReady

If you use any of the native VFP mechanisms like DISKSPACE() to test, NT and Win2K will cause an error dialog to appear unless you alter the OS handling of errors with SetErrorMode()
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