02-21-2020 12:46 PM
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
Solved! Go to Solution.
02-22-2020 10:00 AM - edited 02-22-2020 10:03 AM
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""
02-23-2020 05:35 PM
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