From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting Language -how to enter double quote

Hi Everyone,

 

On scripting language (Python), at call settings tab, under argument expression -how do I enter the following argument:

 

-z "c:\Program Files (x86)\7-Zip\7z.exe" -d 192.168.1.50 --fl2 myFilename.fl2 --fl_sel vf_oy

 

Python script calls "c:\Program Files (x86)\7-Zip\7z.exe" as part of the argument.

 

The complete call:

python fth.py -z "c:\Program Files (x86)\7-Zip\7z.exe" -d 192.168.1.50 --fl2 myFilename.fl2 --fl_sel vf_oy

 

I am using Teststand 2012.  Thanks,

 

Frank

 

 

0 Kudos
Message 1 of 3
(4,061 Views)

I'm not sure what the python step is looking for since I don't have that step type, but if it's expecting an expression for the arguments you can specify the following:

 

"-z \"c:\\Program Files (x86)\\7-Zip\\7z.exe\\\" -d 192.168.1.50 --fl2 myFilename.fl2 --fl_sel vf_oy"

 

Since backslash is the escape character for string literals (like in C/C++/C#).

 

-Doug

0 Kudos
Message 2 of 3
(4,032 Views)

Hi Doug,

 

Thanks for your help and after running with suggested solution I got code error 2  from Python script:

"-z \"c:\\Program Files (x86)\\7-Zip\\7z.exe\\\" -d 192.168.1.50 --fl2 myFilename.fl2 --fl_sel vf_oy"

 

However it works fine if I remove the last two "\\"

"-z \"c:\\Program Files (x86)\\7-Zip\\7z.exe\" -d 192.168.1.50 --fl2 myFilename.fl2 --fl_sel vf_oy"

 

Thanks for your help.

 

Frank

 

0 Kudos
Message 3 of 3
(4,025 Views)