Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? @files and trapping "no disk in drive errors"

Mar
11
0
Because of the way Windows grabs drive letters for USB externals being plugged in, sometime the following doesn't work. Drive j: sometimes is a external USB hard drive and sometimes is a Kingston USB card reader with no card in it.

@set h=%@files["j:\externaldrivename.txt"]

I just want to test if an external drive is is attached on J: and find out if a file exists on the drive. But if the external is not plugged in, and a cardreader is plugged in and gets a hold of drive j: the entire thing errors out with a No Disk error window:

There is no disk in the drive. Please insert a disk into the drive \device\harddisk6\dr10

Is there a way to trap this error? (these usb card readers have a way of grabbing a bunch of drive letters even if nothing is going on)
 
Because of the way Windows grabs drive letters for USB externals being plugged in, sometime the following doesn't work. Drive j: sometimes is a external USB hard drive and sometimes is a Kingston USB card reader with no card in it.



I just want to test if an external drive is is attached on J: and find out if a file exists on the drive. But if the external is not plugged in, and a cardreader is plugged in and gets a hold of drive j: the entire thing errors out with a No Disk error window:



Is there a way to trap this error? (these usb card readers have a way of grabbing a bunch of drive letters even if nothing is going on)
How about the @READY function?

-- Howard
 
Two ideas -- I haven't tested either:

1. You may be able to redirect the error message by putting the command containing the @FILES function in a command group.

2. I believe USBDLM offers an option to not assign drive letters to USB card readers unless they actually contain some media.
 
Howard, the @ready seems to not have difficulty, and if it does, I will explore Charles ideas.

Thanks guys....
 

Similar threads

Back
Top