<p>Is there a way short of writing a seperate batch file or adding a system call to pause or getch or a breakpoint right before the end of the main function to keep a command window open after a command line application has finished running?</p>

<p>Put differently, is there a way in the project properties to run another command after running the target path? If my program is "foo.exe", something equivalent to a batch file containing</p>

<pre><code>@foo
@pause
</code></pre>

<p>Edit: added "or a getch or a breakpoint"</p>

In C++
```
```
#include <conio.h>

// .. Your code

int main()
{
  // More of your code

  // Tell the user to press a key 
  getch();      // Get one character from the user (i.e a keypress)

  return 0;

}
```
```
If you are in a batch file, the command "pause" outputs "Press any key to continue" and waits for a keypress.