Quantcast
Channel: All NI TestStand posts
Viewing all articles
Browse latest Browse all 24494

Re: Passing arguments to exe using the Argument Expression

$
0
0

Dear ShockHouse,

 

I have created a *.bat file with all the needed commands and I have chosen to call that file from TestStand. It works. So this may be a solution. However, if you need to change the source and destination parameters, you will still need some programmatic file editing before the actual call. It can be done but I do not believe this is the most elegant solution. What do you think?

 

I was getting frustrated with the setup for the cmd.exe. As you indicated, I have chosen the cmd.exe as the target executable. Inside the argument expression I placed the following:

 

"/C C:\Program Files (x86)\.....>MyApp.exe -input \""+ Locals.Source_File+"\" -format s19 -output\""+ Locals.Destination_File+"\""

 

The local variables are just strings initialized to the values of my file paths. For example: E:\file1.txt

 

Now, if I check the expression using the Check Expression for Errors option it says that all is fine. However, if I check this using the Sequence Analyzer, it will indicate an error: Rule : All escape sequences used in expressions must be valid
Description : The sequence analyzer checks expressions for valid escape sequences. Improperly escaping
paths usually leads to using invalid escape sequences, which are rarely intended

 

So I modified the argument as:

 

"/C C:\\Program Files (x86)\\.....>MyApp.exe -input \""+ Locals.Source_File+"\" -format s19 -output\""+ Locals.Destination_File+"\""

 

It executes but does not produce any results.

In conclusion, if you still have the patience, please check to see if my argument needs a change. I believe I am missing something. Overall, I believe it can be more elegant just to modify the local variables and keep the executable call unchanged.

 

Thank you for all your efforts. Have a nice day.

 

 

 


Viewing all articles
Browse latest Browse all 24494

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>