0

I tried this:

start patcher.exe pause

Then new console window of my app appears.

and this:

cmd.exe patcher.exe pause

Appears cmd without execution of my prog.

and this:

cmd.exe patcher pause

Then appears cmd, I must type "exit" and then my pro starts, but in new console again.

I need my console to not appear, but write all messages in that started bat.

5
  • what do you mean with "write in that started bat"?
    – Stephan
    Jun 27, 2014 at 17:51
  • My app is already console. Currently, if I start the bat, appears two consoles (bat and my prog). I need that only single console will be shown, like I started it from cmd.
    – Kosmo零
    Jun 27, 2014 at 17:52
  • what happens when you just try patcher.exe? (without start, cmd or something else)
    – Stephan
    Jun 27, 2014 at 17:57
  • appears two consoles...
    – Kosmo零
    Jun 27, 2014 at 17:57
  • 1
    ok, then the application itself opens another console window. Maybe, there are some parameteres with the application to suppress it (try patcher.exe /? or take a look into it's documetation). If not, I'm afraid, you're stuck.
    – Stephan
    Jun 27, 2014 at 18:00

2 Answers 2

1

The reason that this didn't work

cmd.exe patcher.exe

is that isn't how you pass a command to cmd.exe. Try

cmd.exe /C patcher.exe

or

cmd.exe /K patcher.exe

However, that's not likely to remove the duplicate console window. What's probably going on is that patcher.exe is marked as Windows subsystem, so it isn't associated with the console that launches it. Then it launches child processes which are console applications, and since there's no associated console, a new one is created.

You could try using EDITBIN patcher.exe /SUBSYSTEM:CONSOLE to make patcher.exe a console-mode program as well. Then the console will propagate from parent to patcher (child) to grandchild. However, since the program wasn't written or tested to run this way, you could find some unintended consequences.

1
  • To be honest, this answer worth more to be accepted, because of editbin thing that really solved my problem.
    – Kosmo零
    Jun 27, 2014 at 18:53
1

from the comments to your question it looks like the application itself opens another console window.

Maybe, there are some parameteres with the application to suppress it (try patcher.exe /? or take a look into it's documetation). If not, I'm afraid, you're stuck.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.