Jump to content
Sign in to follow this  
Kivin

Detect disc

Recommended Posts

Kivin

Hi everyone!

Is anyone know how I can made programm autodetect disc?

I meen detect inserting disc into CD-rom or removable disc into USB & skip floppy?

Thanks

Share this post


Link to post
Share on other sites
ChrisL

Does DriveStatus() not do what you want?

DriveStatus ( "path" )

Return Value

Value ....... Interpretation

UNKNOWN ....... Drive may be unformatted (RAW).

READY ....... Typical of hard drives and drives that contain removable media.

NOTREADY ....... Typical of floppy and CD drives that do not contain media.

INVALID ....... May indicate the drive letter does not exist or that a mapped network drive is inaccessible.

Edited by ChrisL

Share this post


Link to post
Share on other sites
Emiel Wieldraaijer

Hi I can't get it working

I want to exclude a floppy but include all other , the following code will only exclude the floppy when nog floppy is inserted

CODE
Func DriveInfo()

$DriveList = "|"

$drive_set1 = DriveGetDrive("ALL")

for $i = 1 to $drive_set1[0]

$DriveType = DriveGetType($drive_set1[$i]) ;

if $DriveType = "Fixed" or ($DriveType = "Removable" and $DriveStatus <> "NOTREADY") or $DriveType = "RAMDisk" then

$DriveStatus = DriveStatus($drive_set1[$i])

$drive_set1[$i] = StringUpper($drive_set1[$i])

$DriveList = $DriveList & $drive_set1[$i] & "|"

GUICtrlSetData ($List_d1,$DriveList,$drive_set1[1])

endif

next

EndFunc

Could someone help me

Thnx

Emiel

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.