LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using SYSTEM EXEC with Multiple Quote Commands

Solved!
Go to solution

This command will not run with LabVIEW System Exec VI:

 

cmd /c "C:\my path\myapp.exe" /f:"%USERPROFILE%\Desktop\App A B C.lnk" /a:c /t:"C:\App A B C.exe"

 

Here LabVIEW SYSTEM EXEC interprets   C:\my   as the executable to run. However the exe is myapp.exe

 

However, if I remove all the other quotation marks after ....myapp.exe"  the command is correctly interpreted. But then I need those other quotation marks because the arguments have spaces in-them.

 

So how do you use LABVIEW SYSTEM EXEC when the arguments also need the double quote marks?

 

Anthony

 

 

0 Kudos
Message 1 of 3
(2,199 Views)
Solution
Accepted by Anthony_L

Try using the "/s" flag as well.

 

This changes the parsing of quotation marks when calling cmd, and will allow you to for example enclose the entire string in quotations.

 

Then you can try the following:

cmd /s /c ""C:\my path\myapp.exe" /f:"%USERPROFILE%\Desktop\App A B C.lnk" /a:c /t:"C:\App A B C.exe""


GCentral
Message 2 of 3
(2,137 Views)

Thanks!

 

Just tested that and it worked perfectly. Worked OK when preceded by both:

 

cmd /c, and

cmd /s /c

 

Thus the two double quotes at the START and END will resolve the scenario where the arguments have quotes as well.

 

Thanks again

 

Anthony

Message 3 of 3
(2,107 Views)