09-06-2012 10:37 AM
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
Solved! Go to Solution.
09-07-2012 05:05 AM
bump.
Thanks for any help in advance.
09-07-2012 05:50 AM
Did you try by specifying the working directory ?
09-07-2012 06:34 AM
Try
cmd /s /c "C:\Test\Program.exe "-c::C:\Documents and Settings\maciej\Desktop\Measurement and Automation\test\current.cfg" -m::a"
09-07-2012 08:19 AM
@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.