Hi!
Try using this code...
*************************************
LOCAL lcReturn
*-- Code begins here.
*-- Defines from Winbase.h
#DEFINE SEM_FAILCRITICALERRORS 0x0001
#DEFINE SEM_NOGPFAULTERRORBOX 0x0002
#DEFINE SEM_NOALIGNMENTFAULTEXCEPT 0x0004
#DEFINE SEM_NOOPENFILEERRORBOX 0x8000
*-- SetErrorMode determines whether the system handles
*-- serious errors or whether the program handles them.
DECLARE INTEGER SetErrorMode IN win32api INTEGER
*-- SetErrorMode returns to what the flags were last set.
*-- You need to store this in lnResult so that you can set them
*-- back the way they were before calling SetErrorMode.
*-- Failure to do so can produce unpredictable results
*-- when encountering future errors. SetErrorMode only
*-- applies to the current process and therefore only affects
*-- the FoxPro program that called SetErrorMode.
lnResult = SetErrorMode(SEM_FAILCRITICALERRORS)
**-- Test the FoxPro DISKSPACE() function. If you get a -1, then
**-- there is no disk in the drive.
*IF DISKSPACE("a:") = -1
* MESSAGEBOX("No disk present.")
*ELSE
* MESSAGEBOX("Drive is ready.", 0)
*ENDIF
*-- Put things back the way you found them.
lnResult = SetErrorMode(lnResult)
*-- Test DISKSPACE() again. If there is no floppy in the drive,
*-- a Windows NT system dialog box appears.
IF DISKSPACE("a:") = -1
MESSAGEBOX("No disk present."+chr(13)+"Please insert disk in Drive A:")
ELSE
MESSAGEBOX("Drive is ready.", 0)
ENDIF
*-- Code ends here.