LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the current windows username

Solved!
Go to solution
I was wondering if there is a way to get the current windows pc username in labview?
If there is a way bwsides navigating manually to thr user folder and stripping the path please let me know.
0 Kudos
Message 1 of 12
(8,753 Views)

The Application class in VI Server also has a User Name property, so you can just drop a property node and select that property, but I don't know for sure that it will always take the correct name.


___________________
Try to take over the world!
0 Kudos
Message 3 of 12
(8,738 Views)
Solution
Accepted by topic author Nando88

this is one of this method 

Message 4 of 12
(8,727 Views)

can you please save it in labview 2013, so I can view it?

0 Kudos
Message 5 of 12
(8,705 Views)

here you are 2013

0 Kudos
Message 6 of 12
(8,700 Views)

That is exactly what I needed.

Just one more question, where can I find that property node, so that I can use it in a different app, because from my experience, when I copy a property node to another app, it no longer works, because it loses its reference.

0 Kudos
Message 7 of 12
(8,692 Views)

prperty.jpg

see this image 

0 Kudos
Message 8 of 12
(8,688 Views)

Property and Invoke nodes are reference based, sorta like working on an object.  You need to reference the object, and unless you do it can't work.  Control references can be implicit, or explicit, but in both cases the function needs to know what what object it is acting on.  Copying just the function is like copy a subVI that needs to act on a file reference.  It can't work without knowing what file it needs to be working with, this information and more is provided by the reference.

 

The Visible property node can make controls visible, or invisible.  If I copy the Visible property node but don't provide the reference to the control to act on, then it will give an error saying it can't make the object visible because no object was provided.  There's lots of examples in LabVIEW of object and reference based functions, from DAQmx, to File I/O.  The general idea is you do an open or create reference, you then work on the reference, and close it when you are done.

0 Kudos
Message 9 of 12
(8,670 Views)

To be clear, in this case you don't actually need to wire the reference into the node. For both the Application class and the VI class, if you do not wire a reference in, the current application or VI will be used, so both of these examples will work:

 

prop.png


___________________
Try to take over the world!
Message 10 of 12
(8,610 Views)