LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File path control

Solved!
Go to solution

I'm trying to modify a program that was originally created to be used by a single user so everything has a file path tied to the person. My goal is to change the file paths so that when anyone opens the program the paths will go to their desktop and find a folder there.. My question is what is the best method to make the initial file path be the current users desktop but if they choose that can change this path for the current session?

0 Kudos
Message 1 of 6
(4,097 Views)
Solution
Accepted by topic author daqrookie15

Use the Get System Directory VI to get the path to the user's desktop and then write the the Browse Options->Start Path property of the path control.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(4,079 Views)

 

You need to get the actual desktop path. Get System Directory will do that for you.

 

You need some way to replace the system directory in the paths. I'd use some format like "%DESKTOPDIR%\file.txt", and then use a VI to replace the (optional) "%DESKTOPDIR%" with the actual desktop path.

 

 

Message 3 of 6
(4,068 Views)

How do I create the first part of your code (I'm very new to labview coding).

0 Kudos
Message 4 of 6
(4,042 Views)

@daqrookie15 wrote:

How do I create the first part of your code?


Look in the File I/O->File Constants palette.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(4,022 Views)

@daqrookie15 wrote:

How do I create the first part of your code (I'm very new to labview coding).


CTRL+space, then type "get system directory" and hit enter.

0 Kudos
Message 6 of 6
(3,969 Views)