running console app in same console 
Author Message
 running console app in same console

Hi,

I'm running a console script, and from within it starting another console
app.  At the moment it creates a new window for the new app, but is there
any way to make it run within the same app?

cscript first.js

first.js--
    WScript.Echo( "in 1" );
    var shell = new ActiveXObject( "WScript.Shell" );
    shell.Run( "cscript second.js", 1, true );

second.js--
    WScript.Echo( "in 2" );

So I want to see in the same console window...

in 1
in 2

However at the moment I see

in 1

in the first window, and then another window created and

in 2

in that.

Any ideas for how to get a sub process running sharing the same console?

Brodie.



Mon, 11 Aug 2003 08:33:58 GMT  
 running console app in same console
In WScript 5.6 beta 1, the WshShell object has a new Exec method that does exactly that...

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


Quote:
> Hi,

> I'm running a console script, and from within it starting another console
> app.  At the moment it creates a new window for the new app, but is there
> any way to make it run within the same app?

> cscript first.js

> first.js--
>     WScript.Echo( "in 1" );
>     var shell = new ActiveXObject( "WScript.Shell" );
>     shell.Run( "cscript second.js", 1, true );

> second.js--
>     WScript.Echo( "in 2" );

> So I want to see in the same console window...

> in 1
> in 2

> However at the moment I see

> in 1

> in the first window, and then another window created and

> in 2

> in that.

> Any ideas for how to get a sub process running sharing the same console?

> Brodie.



Mon, 11 Aug 2003 10:04:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using WshShell.Run to launch console app

2. How to Control a Console (old DOS) App...

3. VBScript front-end to a console app.

4. Execute console app to same window

5. How to Control a Console (old DOS) App...

6. How to Control a Console (old DOS) App...

7. How can I call a console app from WSH in same console?

8. Check Application running on console

9. run external command in same console window

10. how to run a program and same the output to the same console

11. HOWTO: Dynamically create, run, and delete a .NET console application from WSH

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

 

 
Powered by phpBB® Forum Software