Solution
Solution 1
The "
Get System Directory VI" can return the file path for many username dependent directories. After placing the function, you can select the directory via the enum input. The function will then return a file path.
Solution 2
You can obtain the Windows user name in LabVIEW using the System Exec VI. Use the command
echo %username% with the System Exec VI to programmatically obtain the Windows user name in LabVIEW. This value can then be used with the "build path" function, to create your file path.
Figure 1 System Exec VI
Solution 3
You also can obtain the Windows user name using the Application:User Name property. After you add the Property Node to the block diagram, right-click
Property and select
Select Property»Application»User Name. This value can then be used with the "build path" function, to create your file path.
Figure 2 User Name Property Node
The User Name property returns the Operating System user name from Revision History. If you changed the default user name settings of Revision History, the User Name property might not return the correct user name. Use the System Exec function instead. Both techniques result in the same string.
Figure 3 User Name Output