Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am on windows 7 command prompt. When I run the following command

"C:\Program Files\abc.exe" help  > out.txt

abc.exe is a third party program which displays some info. What happens is that a new window opens up, abc.exe help prints the output on the new window, the window then closes and I get back to my original window. The out.txt file remains empty.

How can I prevent abc.exe from opening a new window. Can I force it to display its output on the same original window so that it can be redirected to out.txt.

share|improve this question

migrated from stackoverflow.com Jun 5 '13 at 18:01

This question came from our site for professional and enthusiast programmers.

1  
Can you post some of the abc.exe code? – demonofnight Jun 5 '13 at 15:03
    
@demonofnight: The question says abc.exe is a third party program, which means that's probably unlikely. – Ken White Jun 5 '13 at 15:29
    
Its an EMC program to get some details about the storage system. – Sumedh Jun 5 '13 at 16:07

It may be that the application doesn't output to STDOUT or STDERR but try this

"C:\Program Files\abc.exe" help  > out.txt 2>&1
share|improve this answer
    
That did not work. – Sumedh Jun 10 '13 at 17:26
up vote 1 down vote accepted

I was able to solve this.

In windows there is an option called "Open command prompt as Administrator". A new window does not open up in that case.

share|improve this answer
    
Works for me. But why? @Sumedh do you have any explanation? – CAMOBAP Oct 26 '14 at 12:29
    
I have no idea, why this works. – Sumedh Oct 27 '14 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .