0

In Linux it is very easy to start a cgi program from a batch file with a certain standard input:

echo "name=john&city=abc" | mycgiprogram

Now I want to do the same in a batch file.

I learned already that in the Windows cmd.exe shell you have to write "start" to start an executable file:

start mycgiprogram

But how is it possible to transfer a certain input string as in the above linux example to the cgi program?

Thanks a lot in advance

2
  • 2
    You can pipe output from one command to another command the same way in a batch file. Commented Oct 29, 2015 at 14:55
  • The solution on Windows: echo "name=john&city=abc" | mycgiprogram Commented Oct 29, 2015 at 19:57

1 Answer 1

1
echo name=john^&city=abc | mycgiprogram

No quotes, as those will be echo'd, too. You need to escape the &, so it will not be interpreted by the command shell.

You do not need start to run a program, that would be resembling the appended & in unix, in that it starts the program in parallel in a separate shell.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.