08-18-2015 09:36 AM
How do I get the names besides C:, D:, ? In my application, I plug in a USB drive, a new drive will be mounted. I tried getLatestDrive.vi in Labview but had problems on some PCs. When my DUT is a virgin board, Labview finds the latest drive correctly. But when the DUT is a non-virgin board, Labview finds a local hard disk E:\ drive which is wrong. Again, the problem was found only on some of the PCs not all the PCs we've tested on. Since the DUT's drive name (besides the letter E: or I:, etc.) is known to me. So I want to find a function which lists the full names of the drives to locate my DUT drive without mistakes.
Thanks very much!
Spring
Solved! Go to Solution.
08-18-2015 10:32 AM
I'd suggest this function to get drive name.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364996(v=vs.85).aspx
Also using the command line you can get it with something like this.
wmic logicaldisk get volumename
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-18-2015 11:02 AM
Hello Hooovahh,
Thanks very much! I tried wmic logicaldisk get volumename with the systemexec.vi and it returned the volume name I was looking for. Now, how do I get the disk info as well (such as E:\ or I:\, etc.)? That command line only returned the volume name.
Best regards,
spring
08-18-2015 12:06 PM
wmic logicaldisk get name
You can read up on the help wmic is pretty useful, try
wmic logicaldisk get /?
or
wmic logicaldisk /?
or
wmic /?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-19-2015 08:07 AM
Thanks Hooovahh!
I've already found a solution:
http://forums.ni.com/t5/LabVIEW/Listing-mounted-drives/m-p/3179913#M919779
Best regards,
Spring
08-26-2015 08:57 AM
Hello Hooovahh,
I found that ListFolder.vi only worked on some of the machines. On the other PCs where my application was deployed, it didn't work. So I replaced that Labview vi with a system Exc.vi calling for this DOS command "Cmd /C wmic logicaldisk get DeviceID" and came up with a solution! It worked on the machines where ListFolder.vi didn't work! So, I wanted to thank you very much for your valuable advices on this wmic thing! 🙂
Best regards,
Spring