From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Open a batch File as a Standard User from System Exec.vi

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

 

0 Kudos
Message 1 of 2
(1,896 Views)

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)


GCentral
0 Kudos
Message 2 of 2
(1,849 Views)