LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I get Labview to give me a array of what hard drives are on my local computer???

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.

0 Kudos
Message 11 of 15
(1,677 Views)

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.

Message Edited by wired on 01-17-2009 11:04 AM
0 Kudos
Message 12 of 15
(1,673 Views)
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 🙂
0 Kudos
Message 13 of 15
(1,668 Views)

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).
Message 14 of 15
(1,640 Views)

Is there any way to limit this to just local hard drives and not included network drives?

0 Kudos
Message 15 of 15
(1,372 Views)