LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Using System Exec.VI to pass Dir Paths with spaces to Program

When using the system Exec.VI, I am trying to call a remote executable program which takes in a source filename and a  destination filename
I am running into diffculty because the command line interface does not like dir folders with spaces in their names.  Does anyone know how to remedy this?
 
cmd /c "C:\Labview Programs\Georges Program\report.exe"  SourceFile DestinationFile
 
Problem exists when I have Sourcefile defined as C:\Labview Programs\source.txt due to the space in the directory...
 
0 Kudos
Message 1 of 3
(1,206 Views)
Hi id.  Did you try passing the string to system exec.vi including the double quotes?

Here is a string we pass to system exec.vi, copied directly from the string constant:

net stop "national instruments variable engine"

works just fine.  Another option to try would be a single quote.  Or are you having a different error?

Matt
Message 2 of 3
(1,194 Views)

I know this is an old post, but I experienced the same thing as the OP, and for anyone trying to figure it out, the caret key can help you pass the correct characters to the system exec command.

 

For example... I had the command:

cmd /k "..\Get Data\My Data.exe"

 

To get it to work, I had to change my string to:

cmd /k ^"..\Get^ Data\My^ Data.exe^"

Message 3 of 3
(902 Views)