09-27-2013 12:18 PM
Hello All:
I'd like to be able to take the user name from the computer (who is logged in) and bring it into the VI, preferably as a string.
Solved! Go to Solution.
09-27-2013 12:31 PM - edited 09-27-2013 12:31 PM
Looked through the application property nodes?
09-27-2013 12:45 PM
I was trying to use this https://decibel.ni.com/content/docs/DOC-24358
but I couldnt get it to work right I kept getting an error code 1018 "GetCurrentUserName.vi<ERR>
Win API Call "GetUserNameEx" failed."
But your soultion works too, and its less cumberson since I dont have to call a dll. Thanks man.
09-27-2013 02:16 PM
Just be aware that the returned value is the user that launched the program - A "Run as Administrator" will return a different value than the user that's logged in. That's where the Win API call is helpful, that'll return the user that's logged in regardless of who launches the application.
But if it's not a big deal, the property node certainly is an easier solution.