02-15-2020 07:38 PM
Hello,
I have to launch a batch file from LabVIEW. I use System Exec.vi to call command prompt to launch batch file.
The batch file runs and immediately closes.
Also, I have seen that if I go to the folder and Right click on the batch file and select 'Open', the batch file runs fine. But If I select 'Run as Administrator', the batch file runs and immediately closes.
Same is happening in my LabVIEW program.
How to make the program to Open and not Run as Administrator.
Or may be I have to put as Run as Standard User in LabVIEW. How to do this.
Thank you.
Hema
02-16-2020 06:28 AM
If you're running LabVIEW without specifically elevating it to administrative privileges, it won't be running Sys Exec calls as an administrator.
I'm not sure it will even if you do (although it might, perhaps someone else can confirm/deny).
I suspect you might need to prefix your command with "cmd /c" so that a Command Prompt is called to execute your command.
There are more details available here: How Do I Execute a Windows Command in LabVIEW?, Run a cmd command in LabVIEW with parameters (forum post).