LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The filename, directory name, or volume label syntax is incorrect.

Solved!
Go to solution

I have a program that accepts command line arguments.

 

The scheme I've adopted is that every command line argument is shaped like this:

-x::argument

where x is a letter that stands for a switch ( like a mode of operation, and argument is an argument that goes along with that switch ).

:: is my separator.

 

I ran into a problem with the following command line:

If I run the following directly from Windows command line:

"C:\Test\Program.exe" "-c::C:\Documents and Settings\maciej\Desktop\Measurement and Automation\test\current.cfg" -m::a 

All works fine.

 

If I try to use the System Exec.VI:

And pass the following string to it

cmd /c "C:\Test\Program.exe" "-c::C:\Documents and Settings\maciej\Desktop\Measurement and Automation\test\current.cfg" -m::a 

 

I get the error as in the title of the post.

 

Does anyone have any ideas how to make it work from System Exec?

 

It seems that system exec parses the:

"-c::C:\Documents and Settings\maciej\Desktop\Measurement and Automation\test\current.cfg"

part ... figures that this is not a file name ... I don't want it do to that I know it isn't but it is still a valid cmd argument for me.

 

Maciej

 

 



0 Kudos
Message 1 of 5
(18,556 Views)

bump.

 

Thanks for any help in advance.


0 Kudos
Message 2 of 5
(18,530 Views)

Did you try by specifying the working directory ?

Message 3 of 5
(18,527 Views)
Solution
Accepted by topic author Mac671

Try

 

cmd /s /c "C:\Test\Program.exe "-c::C:\Documents and Settings\maciej\Desktop\Measurement and Automation\test\current.cfg" -m::a"

Message 4 of 5
(18,525 Views)

@Matthew Kelton

Thank you Sir! 😉 you solved my problem.

 

@Frabto

Thanks for the suggestion! Specifiyng the working directory would change the way things work for me in this particular case.

The CFG file has nothing to do with the Program.exe and can be in any location.

I would chave to change the implmementation of Program.exe and I wanted to avoid that.


0 Kudos
Message 5 of 5
(18,517 Views)