How To Enter Console App Commands From A Batch File
<p>I am currently developing a C++ program that processes nodes in a binary tree. The project is a console app that takes in commands from cin.</p>

<p>I want to be able to run tests with a script, so I am using a batch file to input a number of commands. </p>

<p>a small snippet of C++ Code</p>

<pre><code>else if (command == "insert")
    {
        cin &gt;&gt; parameter;
        cout &lt;&lt; "insert found: " &lt;&lt; parameter &lt;&lt; "\n";
        bst::insert(parameter, tree);
    }
</code></pre>

<p>the batch file (as it is currently written)</p>

<pre><code>@echo off
cd "Path\Foobar"
app.exe "insert word"
</code></pre>

<p>will only open the application, it won't send in the commands to the application. The command given should tell the app to insert a node with the key "word" into the tree. If the application were to receive an incorrect command, it would flag it with a response. But the app just sits there and waits for commands (manual commands work just fine to).</p>

<p>I've seen numerous documents on writing batch files as well as other questions here, but I just can't seem to wrap my head around why the application will not accept my commands.</p>

<p>I am currently running on windows 10 and using visual studio 2015.</p>