LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with using a batch file to copy a folder of VI's to the user.lib of the most recent version of LabVIEW

Hello,

I am attempting to use a batch file to copy a folder of VI's (called "SensorDAQ") into the user.lib of LabVIEW. Because multiple versions of LabVIEW can co-exist on a machine, I need a batch file command that will copy that folder onto the most recent version. Here's what I have (which doesn't work):

xcopy /E /I "SensorDAQ"
"C:\Program Files\National Instruments\LabVIEW\user.lib\SensorDAQ"

For example, under the National instruments folder, there may be a number of different LabVIEW folders (Like LabVIEW 7.1 LabVIEW 8.2, etc).  I want the SensorDAQ folder to be copied only to the most recent version of LabVIEW. If that's impossible, I'd be willing to have the folder be copied to all versions of LabVIEW (just to be safe).

Thanks in advance for any help you can provide.

0 Kudos
Message 1 of 4
(3,023 Views)
I don't why you need to use a batch file, but in the event it is optional you can do what you need with LabVIEW itself. To get the path to the most recent version of LabVIEW you can use the registry VIs. Check the attach VI and image.

Regards;
Enrique


Message Edited by Enrique on 02-06-2007 06:46 PM

www.vartortech.com
Download All
0 Kudos
Message 2 of 4
(3,016 Views)
Thanks Enrique,

I should have clarified. This folder to be copied will auto-install from a CD.  I'm trying to prevent the user from copying it manually to their most recent LabVIEW user.lib foler.
0 Kudos
Message 3 of 4
(3,004 Views)
I am no batch file expert, but I think you could use the IF fuction to test if [National Instruments]/LabVIEW x.y/LabVIEW.exe exists for increasing values of x.y to test for each version of LabVIEW.  When you stop finding higher levels of LabVIEW, you know you have found the newest version of LabVIEW installed.  Obviously, this may not be the most efficient method for determining LabVIEW versions and it may have issues down the road if the LabVIEW installation hierarchy changes. 

While I have your attention, you may look further into batch file possiblities here and here.

Hope this helps,
Spex
National Instruments

To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be has a 2x safety factor...
0 Kudos
Message 4 of 4
(2,990 Views)