I want to run some commands from a cmd window. Currently, they open a new cmd window which closes immediately. This is unfortunate, because I would like to read the output of those commands. I have no control over the commands themselves as they are not a .bat or .cmd, they are another software's command line interface.

I know there are LOTS of questions about how to keep a cmd window open, but I fail to see how they apply to my case: I can't insert any pause commands, and I can't run the command with cmd /K. So what I need is either a way to keep the window open (which apparently is not possible, according to an answer to this question), or alternatively to force the execution of the command in the window I have open. The second alternative is allegedly impossible as well, according to an answer here.

So I'm hoping there is something I've overlooked. Any ideas welcome.


Ah, I got it. The problem was that my cmd did not have administrative privileges, which is why Windows needed my confirmation to start a new window with those. Starting the first cmd as admin resolved the problem, the commands now run inside my window.

Thanks anyway, and I hope this may still help someone else.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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