LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Spectre_Dave

Set vi to run as admin

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined. 

I have had to jump through hoops to create a .net process or use runas to get portions of code to run

when the end used does NOT have admin privileges.

 

Add Option under VI Properties >> Execution to allow setting the VI to run as admin or another user.

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
15 Comments
AristosQueue (NI)
NI Employee (retired)

Question: Can you change the permissions of an EXE that is already running? I thought an EXE was either launched with higher permissions or not and it held that level of access throughout its run. I've never really delved into this, but I didn't think an EXE could be elevated, even if the user was prompted for a username/password. Am I wrong? Are there differences between OSes on this question?

Intaris
Proven Zealot

@AQ

 

This is why the example shown and my tips until now were limited to actually launching a seperate EXE with different rights.

 

I'm not sure it's possible to have part of an EXE with elevated rights and the rest with restricted rights.

Spectre_Dave
Active Participant

What I envision is the main application uses low rights and I create a process that requires elevated rights. That way the user can have low rights but the application can run certain processes as an admin.  Web Browsers work this way - certain processes need admin rights to run i.e. sockets.

 

Yes I created a vi using .net methods but this will break when the .net Framework is upgraded.  That is why I proposed a simpler solution where I can create a Process.vi that has higher rights.

 

I have another application where I xfer Test Results to a server and archive the local files to a new local location.  Again the user needs rights to the directories where the files are and will be.  that is a security issue.  I can create a windows service to do this but that is a royal pain. I hope for a xfer.vi that has admin rights but the main calling program has user rights. The xfer.vi would simple contain the file transfer vis.  I think this is more secure as only the xfer.vi has elevated rights.

 

Sorry for the confusion but I tend to simplify my explainations.

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
Intaris
Proven Zealot

Problem is that the VI is in itself not a seperate process to the rest of the program.  The entire program would probably have to be run with admin rights to enable this kind of thing.  The only other option is really to launch an application (You can create an EMPTY application and load the VI in parallel via command-line) which could then be run with admin rights.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.