01-17-2009 10:27 AM
Under LV8.6 running on Vista, Get Volume info on an empty CD/DVD drive pops up a dialog with "LabVIEW.exe - No Disk" as the title. It requests that you insert a disk into the drive. Button options are Cancel, Try Again, or Continue.
I thought I had a nice way to get drive letters, but I must have tested it when I had a DVD in the drive. Today there was none, and I got the dialog. The Get Volume Info returns an error code of 7, so you need to have an exception handler to cancel the error code on a match of 7, and set the error handler to show no dialog. You can optionally then skip the drives that produce this code (if you only want drives with media in them) or include them.
01-17-2009 11:01 AM - edited 01-17-2009 11:04 AM
Update: In my code, I was just looping through A-Z for drive letters, and doing a Get Volume Info for each one. This worked (without any error exception handling) if I started my computer with NO MEDIA in the drive. Once I add the media and then remove it again, I always get the dialog box IN SPITE of exception error handling. The dialog is a system dialog, not a LabVIEW dialog. I did verify that Altenbach's ListVolumes2.vi does work, however, because it does not provide a drive letter for a drive with no disk in it to the GetVolumeInfo vi. Wish I'd found your VI sooner, altenbach! One more Kudos to you!
P.S. - Note that altenbach's VI does not actually give a list of drives that are on the computer, but a list of drives that have media. This is OK for my application, but may not be for others.
01-17-2009 11:14 AM
01-17-2009 03:30 PM
wired wrote:
Hmmm... unable to add Kudos to your VI post, altenbach. This hasn't ever worked for me - not sure why... if you have any ideas, let me know - I like to give credit where it is deserved 🙂
Thanks! Typically, this is a browser issue. (e.g. certain versions of firefox).
02-19-2013 03:05 PM
Is there any way to limit this to just local hard drives and not included network drives?