How to Check if Disk is in Drive A: and if it is Write Protected
Keywords: xdriveready floppy disk drive
Question:
Do you have functions to see if a disk is in a floppy drive?
Answer:
Here is script to check if a Disk is in Drive A: and if it is write protected.
;*******************************************
;Make sure A:\Drive has Disk in?
;*******************************************
AddExtender("wilx34I.dll")
ready = xDriveReady("a:")
If ready Then Goto write
Else Display(3,"Problem"," No Disk in A:\Drive!")
Break
;*************************************************
:write ;Make sure a:\drive is read/write
;*************************************************
Errormode(@off)
handle= Fileopen("A:\abcxyz.zyx","write") ;Try and create a file
if handle==0
Display(3,"Problem","A:\Drive is Write Protected!")
Break
else
Fileclose(handle)
Filedelete("A:\abcxyz.zyx") ;Delete the file
endif
Errormode(@cancel)
Article ID: W13247
Filename: Check to see if Floppy in Drive A.txt