Equivalent of C 'system()' (Not WScript.Shell.Run) 
Author Message
 Equivalent of C 'system()' (Not WScript.Shell.Run)

Newsgroupies

I'm trying to run a *.js file from the console.

When I shell to a target console app, I'd like to have its console merged
with mine. Just like 'CALL' in a BAT file or 'system()' in a console C app.

WScript.Shell.Run has many options to raise different kinds of new windows;
how can I merge it with the current window?

TIA!

--
 Phlip
======= http://www.*-*-*.com/ ~tegan/home.html =======



Mon, 16 Sep 2002 03:00:00 GMT  
 Equivalent of C 'system()' (Not WScript.Shell.Run)

Not possible in the current release of WSH,  there's a workaround...  Capture the output of the 2nd
and echo (or StdOut.Write it from the caller.

I attached a WSC (batch.wsc) that makes it trivial to do...

  set batch = createobject("batch.wsc")
  batch.execute "cscript.exe myscript.js"
  wscript.stdout.write batch.stdouttext

batch.wsc takes care of all the execution details and exposes captured stdout (and stderr on NT) as
both text and array properties.

--
Michael Harris
MVP Scripting

Newsgroupies

I'm trying to run a *.js file from the console.

When I shell to a target console app, I'd like to have its console merged
with mine. Just like 'CALL' in a BAT file or 'system()' in a console C app.

WScript.Shell.Run has many options to raise different kinds of new windows;
how can I merge it with the current window?

TIA!

--
 Phlip
======= http://users.deltanet.com/~tegan/home.html =======

  Batch.wsc
6K Download


Mon, 16 Sep 2002 03:00:00 GMT  
 Equivalent of C 'system()' (Not WScript.Shell.Run)

Quote:

> Not possible in the current release of WSH,  there's a workaround...

Capture the output of the 2nd

Quote:
> and echo (or StdOut.Write it from the caller.

> I attached a WSC (batch.wsc) that makes it trivial to do...

Thanks, guy!

/(a beat)/

Are you, like, batting these things out just to reply to our posts? or do
you have, like, nothing else to do all day?

I'm grateful, but this prolific style's leaving me breathless!

--Phlip



Tue, 17 Sep 2002 03:00:00 GMT  
 Equivalent of C 'system()' (Not WScript.Shell.Run)
This is stuff I've accumulated and/or written for my own use that I've posted many times before,
though I do occasionally whack something together "adhoc" for a specific post if it's an interesting
or very common question...  Otherwise it's just a lot of copy/paste or drag/drop attachments.

--
Michael Harris
MVP Scripting

Quote:


> Not possible in the current release of WSH,  there's a workaround...

Capture the output of the 2nd

Quote:
> and echo (or StdOut.Write it from the caller.

> I attached a WSC (batch.wsc) that makes it trivial to do...

Thanks, guy!

/(a beat)/

Are you, like, batting these things out just to reply to our posts? or do
you have, like, nothing else to do all day?

I'm grateful, but this prolific style's leaving me breathless!

--Phlip



Tue, 17 Sep 2002 03:00:00 GMT  
 Equivalent of C 'system()' (Not WScript.Shell.Run)
Did you already find a way to automate this cut and paste by script? ;-) A
post comes in, the right answer is created automatically? ;-)) Or are there
multiple Michael Harris' to handle this zillions of cuts and pastes? ;-)))

Uwe
----------------


Quote:
> This is stuff I've accumulated and/or written for my own use that I've

posted many times before,
Quote:
> though I do occasionally whack something together "adhoc" for a specific

post if it's an interesting
Quote:
> or very common question...  Otherwise it's just a lot of copy/paste or

drag/drop attachments.
Quote:

> --
> Michael Harris
> MVP Scripting




Quote:

> > Not possible in the current release of WSH,  there's a workaround...
> Capture the output of the 2nd
> > and echo (or StdOut.Write it from the caller.

> > I attached a WSC (batch.wsc) that makes it trivial to do...

> Thanks, guy!

> /(a beat)/

> Are you, like, batting these things out just to reply to our posts? or do
> you have, like, nothing else to do all day?

> I'm grateful, but this prolific style's leaving me breathless!

> --Phlip



Wed, 18 Sep 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. WScript.Shell Run Doesn't Work???

2. Wscript.shell Run doesn't work

3. i need help with 'wscript.run'

4. i need help with 'wscript.run'

5. WScript.Shell.Run does not pass back errorlevels?

6. Can't use wscript.shell in asp

7. can't CreateObject("Wscript.Shell")

8. Can't Create Object WScript.Shell in Win 98 (1st Ed) and Win 95

9. Can't Create Wscript.Shell object

10. Can't Create Object: WScript.shell

11. Shell.Run executable with multiple args and CrLf's

12. Shell.Run using .lnk (Michael Harris' code)

 

 
Powered by phpBB® Forum Software