WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Floppy and CD Drives

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
File Created: 2001:03:01:14:43:28
Last Updated: 2001:03:01:14:43:28