10-22-2014 05:46 AM
I know that there are solutions ofr achieveing this with executables, and I can do it VI by VI, but I want to do this once, I want them to become part of my development environment, but not all environments, and I wondered if there were a better way than my current plan of creating my own exe to launch labview.
10-22-2014 06:23 AM - edited 10-22-2014 06:29 AM
How about creating a batch file to startup your LabVIEW system which first sets the environment variable and then launches LabVIEW? Executables launched from a batch file should inherit the entire environment of whoever started them up.
Something along the lines of:
SET MYENV="your value"
START "C:\Program Files (x86)\National Instruments\LabVIEW 2014\LabVIEW.exe"
Batch/shell script files may seem so last century, but they are still a viable and very powerfull means in all current operating systems.
10-22-2014 06:32 AM
They do indeed, which is what I'm using on my own machine, but for distribution to our production environment (which all uses labview development environments - scientific research needing quick responses that don't take time to build and deploy sometimes - and this was the design decision my colleagues made) that won't work as an option, unless I turn the batch into an exe, and replace the associated program for VIs to use that exe and alter all links to use it - which is a big job on 40+ machines, but a script to alter on startup would be far quicker. We may just end up permanently setting the environment variables, but I thought I'd ask for any other ideas.
10-22-2014 11:46 AM
Not sure if this helps but I wrote a utility a while ago for reading/writing environment variables. It doesn't do anything special just reg edit stuff and command line.
http://lavag.org/files/file/7-windows-environment-variable-reader-writer/
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord