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.
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.
01-27-2012 11:21 AM
Good morning NI Forums,
I need direction on a file path scan. I'm trying to get to the user name on any system, primarily XP or 7. I'd like to compare the user name from the "Get System Directory" VI with a constant user name.This way I can pass that to a case structure and close LabVIEW if the computer is logged into the wrong user (there are network read/write permissions which is why I need to control where the program isrun from). Any suggestions for the format string constant or maybe a better mouse trap?
I've attached my VI for reference.
Thanks!
Solved! Go to Solution.
01-27-2012 01:27 PM
Hi,
We just discussed this on the phone but I am posting the solution so that others are aware of the solution. You wanted to check if a known username is the current user of the system (on XP or Windows 7) so we worked up a quick VI
Regards,
01-27-2012 01:28 PM
I don't have LV2011.
Have you seen this Knowledgebase article?
Programmatically Retrieving a Windows User Name in LabVIEW
01-27-2012 01:39 PM
Phillip,
I hadn't seen that article. I didn't realize a property node could grab the user name. Thanks for the post!
Tyler
01-27-2012 02:08 PM
Here is updated VI with format string constant and little bit changes in the VI.
Hopefully should work as you are expecting.