LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
olsen7

Set exe to run as admin

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

I am communicating to parker motor controllers through the Ethernet (parker sample code). Apparently since it is Ethernet based, the code uses socket, where the sockets require admin rights (another discussion about ethernet based and admin rights). In order for my VI to connect to the controller I need to run LabView as an administrator. The problem is I am making this program into an executable for production work.

 

When I create the executable it will not connect to the controller unless I am running the application as an administrator. As this program will be used in production I want it to be as simple as possible to perform. I don't think there is a simple way to change the environment to run without the need to run application as an admin. Are there any ideas to either change the executable to run as an administrator through the application builder? My plan is to create an installer through the application builder.

 

Some ideas that I had is to create an installer file and create the executable. Change the privilege level of the executable (properties>compatibility>privilege level>run this program as an administrator). Use a batch file to install drivers and application, then replace application with the one with the elevated privilege level. Another idea I had is use a batch file to do a runas command to run application as an admin. I cannot get either method to work. Does anyone have ideas?

4 Comments
tst
Knight of NI Knight of NI
Knight of NI

I can't look at your code, but you could also check right clicking the shortcut to the EXE and setting that to run as admin.

 

If that doesn't work, I suggest you repost the question to the LabVIEW board. This board is for suggesting improvements to LV.


___________________
Try to take over the world!
olsen7
Member

The suggested improvement is to change the settings of a VI to run as an admin. That way when you create the executable it will elevate the privilege level of the application.

 

I will also post it it on the LabView board.

tst
Knight of NI Knight of NI
Knight of NI

> The suggested improvement is to change the settings of a VI to run as an admin.

 

Then if you don't find a satisfactory solution in a few days, I suggest you start a new thread which makes it clearer.


___________________
Try to take over the world!
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.