'How to enter Y when prompted using Jmeter OS process Sampler

I am currently stuck with executing a command to transfer some file using Jmeter OS process sampler. The transfer is facilitated by a EXE file which I need to invoke and then provide the route and the file names to make that transfer happen along with a Secure Key.

I am successfully able to execute the command but this command when executed prompts the below

Press Y to continue...

I tried a number of ways to pass the input as Y but its doesn't seem to work. I have tried the below options

  1. Echo Y
  2. / set /y
  3. /Q to suppress the prompt
  4. Created a bat file to echo y and then called it out from the OS sampler
  5. Added the whole piece of command to the bat file and then echoed y

and there were few other combinations I tried but it does not seem to work.

If I provide a command in multiple lines of the OS process sampler, it simply appends to the previous command.

Any pointer would really help me out.

enter image description here

enter image description here

enter image description here

PS:- I did go through a number of links one of them was the below.

https://www.blazemeter.com/blog/how-run-external-commands-and-programs-locally-and-remotely-jmeter



Solution 1:[1]

Here is an example on how to delete file c:\temp\test.txt

enter image description here

More information:

Also there are 4 error messages in your script, check jmeter.log file for any suspicious entries as it might be the case your JSR223 Pre-Processor is failing.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T