LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW open csv file via CMD line (Source vs Application).

Solved!
Go to solution

Hey all,

I have two txt files needed for my application to run. I include these files in my installer via the data folder. All this is fine and the application runs as expected. I would like for my user to be able to update these txt files as needed. So in my application there is a shortcut menu that lets the user open these txt files (Faster than using file explorer to find them). The problem is they open in Read-Only mode, so they cannot be edited. I belive the issues is the permissions on the files once they are installed. I can use my source code to open non-installed txt files, but if I try to open the installed txt files I only open in Read-Only. Is there any thing I can do to make my installed txt files open in read-write mode? 

 

This is the code that I am using to open the files:

open_with.PNG

 

These are the installed files that I would like the user to open:

Dealcs2_0-1704207308120.png

 

 

0 Kudos
Message 1 of 3
(475 Views)
Solution
Accepted by topic author Dealcs2

What are you using to install the program? NI Package? LabVIEW's Installer?

 

You are installing the files to the [Program Files] location on a Windows computer. This location is locked to Read Only by default, and usually only admins can have access to this location. Some options you can do:

 

1. Move the text files to a location designed for read/write access like [ProgramData] (useful to share configuration across users) or Users\AppData (useful if you want different configuration per user)
This is the best option. This is how most software works, and how Microsoft recommends applications and data are placed.

2. As part of your installation, if it's run as admin, you could run a batch file that modifies permissions in any location so anyone/user/etc... has read/write access. You would use a batch file like this for the location you have now:

REM Navigates to the folder that contains the folder you want to modify
cd %ProgramFiles%\Remote Desktop Connection
REM Modifies the directory so all Users have permissions to the folder and it's contents
REM Uses the SID for users so this works on multiple languages instead of just English Windows
icacls data /grant:r *S-1-5-32-545:(OI)(CI)F /T
0 Kudos
Message 2 of 3
(466 Views)

Thanks for the quick response! I am using LabVIEW installer. I like the idea of moving the files to ProgramData this seems like the best long term solution. Thanks for the Batch file idea as well, I will play around with it too. 

0 Kudos
Message 3 of 3
(430 Views)