how to run your C++ app in Windows Terminal
- Build your app (generate an .exe file) if you haven't already.
Copy the path of the .exe file (detailed steps below).
Open Windows Terminal.
Paste the path to your .exe file and delete the quotation marks around it. It should look something like this:
PS C:\Users\chris> C:\Users\chris\source\repos\Project1\x64\Debug\Project1.exe
- Press enter.
If you want to run the app again, just press the up arrow until the command to run it reappears. If you will run apps with commands like this often, you might want to know [§] how to create custom terminal commands and [§] how to customize terminal prompts in Windows.
how to copy the path of your app's .exe file
These instructions are mostly for Visual Studio. You must have successfully built your app at least once for the .exe to exist.
- In your Solution Explorer window, right click the line that starts with "Solution".
- Click "Open Folder in File Explorer".
- Open the folder named "x64", and the "Debug" folder within it.
- Get the .exe file's path.
- Windows 10: select the .exe file and in File Explorer's "Home" tab, click "Copy path".
- Windows 11: right click the .exe file and choose "Copy as path."