LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to elevate system exec.vi to administrator on Win7

Solved!
Go to solution

Hi Guys

 

I'm building an installer for our application and would like to inject the non NI hardware driver required for the program to interface with our hardware into Win7.. I'll be using pnputil.exe to add and install our signed driver.. However, pnputil will only work if cmd prompt is ran elevated to administrator (being administrator is not enough using cmd).. This is easily done in the win7 environment (ctrl+shift+enter at the search bar after typing cmd) but is there a command that works on win7 that I could call to enable this elevation to happen without user interacting? I would very much like to create a post install program that the NI installer calls, elevate the program, and then call the pnputil function from the system exec.vi, leaving the system with the driver installed and a plug'n'play experience to the user.. 

 

Any good suggestions?

 

best regards

 

Jacob Navne

LV8.6.1 - win7 / XP

0 Kudos
Message 1 of 3
(4,963 Views)
Solution
Accepted by topic author Navne

If you use the installer's "run command line after install" option, I believe that it runs the command line with the same rights the installer had, which should be the elevated admin rights you're looking for.

 

this has worked for me in the past in win7.

-Barrett
CLD
0 Kudos
Message 2 of 3
(4,945 Views)

It sure did.. Thank you for giving me the faith to go on with the project and try it outSmiley Wink

0 Kudos
Message 3 of 3
(4,897 Views)