LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get username in exe

Solved!
Go to solution

Hello,

 

I am trying to get the current username in an application.  Using a property node to pull the username works great in the development environment however once the vi is build into an exe it fails.  Also tried system exec to pull the environment variable %username% and this as well works great in the development environment however fails once build.  Is there a solution to this? (running LV 2012 on windows7)

 

Thanks,

0 Kudos
Message 1 of 4
(2,438 Views)
Solution
Accepted by topic author Isereau

The example below works in the built exe:

 

http://forums.ni.com/t5/LabVIEW/get-user-name/td-p/634611

 

0 Kudos
Message 2 of 4
(2,432 Views)

Nice link.  But with a win 7 OS its probably easier to just do this

 

 

Then I read Derriks comment on the other thread Smiley LOL Do that instead


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 4
(2,424 Views)

@JÞB wrote:

Nice link.  But with a win 7 OS its probably easier to just do this

 

!1-1.png


An its probably easier to represent a year with 2 digits instead of 4 but that's how you get Y2K, or whatever.

 

I'd recommend the DLL call, more compatability.  Still tied to Windows of course.

0 Kudos
Message 4 of 4
(2,417 Views)