LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change default directory of exe file

I have created a VI that reads a template and writes on the template and saves it to a new file. When i created to an exe file, I would like for this exe to be able to be used on any computer. As such, the directory where i will open my template will change on different computers. Hence I am having this problem of how to change my VI such that it will choose this template in a new computer and set it as its default directory.

 

I understand that in my own computer, I can simple "set current values as default" so that my VI will always open this file from a particular path. But what i need help with is when i put it on another computer where the particular path would definitely be different. I tried using the config file.vi but I could not understand how it is used.

 

Please assist me in this. Thanks

0 Kudos
Message 1 of 2
(2,485 Views)

Hi Aaron,

 

Micorsoft suggest to use folders like UserAppData to store files for your own programs.

 

Put your template in there and use GetSystemDir function to get the UserAppData path...

 

Or you put the template in the program folder or one of it's subfolder (not recommended by MS) and use a relative path to load it...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(2,464 Views)