CIPLEO Posted December 13, 2022 Report Posted December 13, 2022 Hello, I would like to know if it is possible to launch an executable via a VI and if it is possible to launch it as an administrator ? Or if it is possible that the VIPM launches my VI as an adminitrator after the installation of a packet ? Thank you for your answer Quote
Rolf Kalbermatter Posted December 13, 2022 Report Posted December 13, 2022 (edited) 2 hours ago, CIPLEO said: Hello, I would like to know if it is possible to launch an executable via a VI and if it is possible to launch it as an administrator ? Or if it is possible that the VIPM launches my VI as an adminitrator after the installation of a packet ? Thank you for your answer No you can't launch VIs as administrator. You need to launch LabVIEW (or VIPM) as such in order to have a VI executed with administrator rights. Windows does not allow to change the privilege of a process after it is launched, respectively if you find a way to do that you found a zero day hacker exploit, that will be closed immediately as soon as Microsoft learns about it. What you could do is to add an executable that was configured to need administrator rights through a manifest file to the installation package and then launch that. It will cause a privilege escalation dialog when you launch that, and require the user to enter the login credentials for an admin if he isn't already admin. The dialog will appear anyhow even if he is an admin already, but as admin the user won't have to enter the password again, but still confirm that he does want to have that executable launched. Edited December 13, 2022 by Rolf Kalbermatter Quote
CIPLEO Posted December 14, 2022 Author Report Posted December 14, 2022 Hello Rolf, Thank you very much for your answer, indeed I had seen this option so I'll go on it. Quote
Zou Posted December 14, 2022 Report Posted December 14, 2022 You can also configure the exe (or it's shortcut) to "Run this program as an administrator" on the file properties dialog window in the Windows Explorer. One way to verify if the LabVIEW is run as admin is: the path ctrl doesn't works with drag & drop. Quote
Rolf Kalbermatter Posted December 14, 2022 Report Posted December 14, 2022 (edited) Or you can execute this VI to know if your process is elevated or not. Is Elevated.vi Edited December 14, 2022 by Rolf Kalbermatter Quote
CIPLEO Posted December 20, 2022 Author Report Posted December 20, 2022 Hello ZOU and Rolph, Thanks for your answer, I modified the manifest so that the executable runs as administrator. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.