question

DarkMatter-9401 avatar image
0 Votes"
DarkMatter-9401 asked RLWA32-6355 commented

Why does windows console program run in new command prompt?



Recently, I was charged with maintaining a windows console application written in C++ in Visual Studio. I can run it from the console by just typing the program name, for eg. program_name.exe . However, when I run it in windows 10, it opens a new command prompt window and prints its output to that window. However, in other versions of windows, like windows server 2019 it does not open a new command prompt window but prints its output in the same command prompt window from where it was launched. I don't want it to open a new command prompt. I want it to give its output in the same command prompt where it was launched. How do I fix this issue in windows 10?
Additional info: This application is a .exe which also invokes a .dll library.

c++
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You say console and you say command prompt. I assume they are the same thing but since you are using the two terms perhaps there is a difference that is not clear.

0 Votes 0 ·

Whats your requestedExecutionLevel set to?

0 Votes 0 ·

Are you sure the Visual Studio project is a console project? Do any of the DLLs write to the console?

0 Votes 0 ·

I'm just trying to create a fortran executable that can run inside the windows command prompt and accept input files inside the command prompt, preferably fed by a .bat file. I tried the standard graphics application project and that works, but it opens a separate window. I want an executable to run inside of the command prompt, not a separate window.

0 Votes 0 ·

Then you need to create a "console application".

1 Vote 1 ·

Then as I said you need to create a separate question and since your program is FORTRAN this is not the forum for that question.

1 Vote 1 ·
Show more comments

1 Answer

sanneraj-5724 avatar image
0 Votes"
sanneraj-5724 answered SimpleSamples commented

Did you ever figure this out? I also have an .exe that I can run from the command prompt, but it opens in a separate window. I have to pass about 10 input files to the .exe in order for it to run. It's a major pain to type out all of those files, but running the .exe with a .bat file does not communicate to the new window that opens.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@sanneraj-5724, you should create a new question. In the question provide details. For example, did you write the program you are asking about or at least do you have the source code and can modify it? You need to create a new question for that because although the symptoms might appear the same, the cause might be very different.

0 Votes 0 ·