From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to mass password-protect vi's?

I just finished a project with several hundred vi's and "they" want each vi password protected.
Is there a way to do this without going into each individual vi? LV5.1.1
0 Kudos
Message 1 of 13
(5,720 Views)
You can use the 'Save With Options...' in the File menu to make life easier.
I believe you only have to open the top-level vi (double check with your Help), then:
Select 'Save with options'
I'd choose 'Custom save'
For sanity, I'd choose 'prompt for each' in the selected options drop-down.
And check 'Apply new password'.

Note: be careful about the 'remove diagram' option - once you select that and save, you will never recompile that vi again!

You will be prompted for each vi (unless you chose no prompts or one prompt), but in an assembly-line mode.

Good Luck, Doug
Message 2 of 13
(5,720 Views)
Thanks. This is an excellent answer that gives the easy solution.
However, in order for the password protection to take effect, remember to exit and re-enter LabVIEW afterwards or to use the "Edit|Clear Password Cache" option, as indicated in an answer to a previous query on this site(KnowledgeBase Document ID 182BA0IT)
Message 4 of 13
(5,720 Views)
You should be able to write a small program that finds all VIs in memory or all VIs in a specific folder and then use an Open VI Reference to each one with then an Invoke Node function. The method you want to invoke is SetLockState.
Message 3 of 13
(5,720 Views)
Anyone who tries to answer a question deserves an "excellent" rating. Even though the other answer I received was preferable in terms of time and pain, this one also added to my store of LabVIEW information. Thanks.
0 Kudos
Message 5 of 13
(5,720 Views)

Hi,

I noticed that this thread was about 6 years old. I am looking to do something similar, mass password-protect 100s of VIs and .lib files. Currently using LabVIEW 8.0.1.

Is there an efficient and fool-proof way to password protect all the VIs?

Appreciate your comments/suggestions. Thanks.

 

0 Kudos
Message 6 of 13
(5,372 Views)
Hi Troy,

You can do a recursive directory listing (with a *.vi pattern) and then loop over all VIs and use open VI reference followed by an invoke node (SetLockState) as mentioned above.

Hope this helps,
Daniel

Message 7 of 13
(5,360 Views)
In LabVIEW 8.0, you can use vi.lib\utility\libraryn.llb\Recursive File List.vi to quickly get an array of paths to all files in a given folder (and all subfolders).  You can then have some conditional code to either do the Open VI Reference -> Set Lock State -> Save trick for VIs, or the following method for LVLIBs:
 
 
Hope this helps,
-D


Message Edited by Darren on 01-09-2008 04:12 PM
Message 8 of 13
(5,354 Views)

Thanks Dan and Darren.  I will try that out. 

I am assuming that in a similar way, I can unlock all the VIs and .lib files. Correct me if I am wrong. Thank you.

 

 

0 Kudos
Message 9 of 13
(5,341 Views)
Yes, to unlock you just set the lock state to "Not Locked" (of course you'll have to provide the password to unlock the VI).

Message 10 of 13
(5,329 Views)