From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 8 on installed executable, must run as admin

I am getting an Error 8, incorrect permissions to access file.  This occurs when I run an installed executable under Program Files.  If I run my application as an administrator, I don't get this error.  Specifically, I am trying to open a file that's in the \data directory under the application folder.  Is there a way to change the permissions of a destination folder in the build specifications?

0 Kudos
Message 1 of 7
(2,986 Views)

Is this under Windows 7? If so, that's an operating system limitation. Windows 7 does not allow you (for good reason) to mess around in the program's application directory. You should be writing to the Program Data folder instead. LabVIEW has file constants that you can use to get specific directories rather than hard-coding them (if that's what you're doing).

0 Kudos
Message 2 of 7
(2,982 Views)

Thanks, that is definitely what's going on.  When I use the default data VI in LV2009, it uses a data folder under Documents.  Is there a way for this to point to the actual "C:\Program Data\" folder on Win7, but point elsewhere on previous versions?

0 Kudos
Message 3 of 7
(2,976 Views)

Use the Get System Directory VI (in the File Constants palette). The value "Public Application Data" should return "C:\Program Data".

Message 4 of 7
(2,969 Views)

You can use the Application property node to determine which OS you are running. To access this property node follow these steps:

Bring up your diagram and right click to get the vi palette.
1. In your functions palette go to Programming>>Applicaion Control>>Property node. Drag a property node into your block diagram.
2. Select the following properties OperatingSystem>>Name and OperatingSystem>>Version

Untitled.jpg

Windows 7 will show up as Name: "Windows NT" and Version: "6.1".

Sev K.
Senior Systems R&D Engineer | Wireless | CLA
National Instruments
0 Kudos
Message 5 of 7
(2,944 Views)

Go into the installer properties -> source file settings -> 'your folder' and set the 'unlock flag'!

RTFM: "..When you unlock a file or folder, you remove administrator access requirements from deployed files and folders, which allows anyone to edit files and folders after they have been installed." 😄

0 Kudos
Message 6 of 7
(2,918 Views)

Thank you for reply,....Smiley Happy its working...

0 Kudos
Message 7 of 7
(2,696 Views)