run external command in same console window 
Author Message
 run external command in same console window

How does one run an external command in the same console window?

Is there a way to call CreateProcess()?

The shells Run command seems to create a new console window.  My main problem
is that the external program is having a problem and it flashes by on the
screen too fast for me to see error messages.  I have built up a command string
and echo it to the console and run it by hand and it has no problems.  So,
there seems to be something special problem about the Run() command.

Thanks for any help.



Thu, 26 Sep 2002 03:00:00 GMT  
 run external command in same console window
IF this program will support piping it's output (MyProgram.exe>ErrorLog.txt)
then maybe it will throw the error to this file.

On the other hand you could cheat a little by creating a batch file that
issues the command you use in RUN and then put a PAUSE statement in the
batch file so it stays on screen.

Your working directory might be screwing with your program. By default the
directory the script is executed from is going to be your working directory.
Test this by being in the directory the script is in and then issuing your
command like you have.

In addition, look into the environment this program runs in, are you using
%COMSPEC% on your command line?

Shawn


Quote:

> How does one run an external command in the same console window?

> Is there a way to call CreateProcess()?

> The shells Run command seems to create a new console window.  My main
problem
> is that the external program is having a problem and it flashes by on the
> screen too fast for me to see error messages.  I have built up a command
string
> and echo it to the console and run it by hand and it has no problems.  So,
> there seems to be something special problem about the Run() command.

> Thanks for any help.



Thu, 26 Sep 2002 03:00:00 GMT  
 run external command in same console window
Thanks.  I had already thought about creating a batch file and running that.
However, this defeats the purpose of using wsh.  I might suggest to
microsoft to be able to call CreateProcess() or system() or something
similar directly so that one can run another process in the same console
window that the script is running in.

Does anybody know how to run another program in the same console window?
Is there an easy way to call CreateProcess()?

Quote:

> IF this program will support piping it's output

(MyProgram.exe>ErrorLog.txt)
Quote:
> then maybe it will throw the error to this file.

> On the other hand you could cheat a little by creating a batch file that
> issues the command you use in RUN and then put a PAUSE statement in the
> batch file so it stays on screen.

> Your working directory might be screwing with your program. By default the
> directory the script is executed from is going to be your working
directory.
> Test this by being in the directory the script is in and then issuing your
> command like you have.

> In addition, look into the environment this program runs in, are you using
> %COMSPEC% on your command line?

> Shawn



> > How does one run an external command in the same console window?

> > Is there a way to call CreateProcess()?

> > The shells Run command seems to create a new console window.  My main
> problem
> > is that the external program is having a problem and it flashes by on
the
> > screen too fast for me to see error messages.  I have built up a command
> string
> > and echo it to the console and run it by hand and it has no problems.
So,
> > there seems to be something special problem about the Run() command.

> > Thanks for any help.



Thu, 26 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to run external command but leave window open

2. Running two commands in the same console

3. running console app in same console

4. run net.exe (net send) with external commands

5. run external commands in-process?

6. Running external commands from within ASP pages

7. how do I hide a console window when running a script from an HTA

8. How to run an external program without invoking a console window?

9. how to insert a console command (dos ) in a jscript

10. Console Command Trainer

11. Displaying Hidden Command Console Backgroud Process

12. Running Acrobat Distiller from Windows Command Line

 

 
Powered by phpBB® Forum Software