I would like to run a script and have it open a Command/DOS window and send
all its outputs to the window. Is there a easy way to do this?

Thanks,

Ken

Re: Attaching A Dos Window by Christoph

Christoph
Tue Nov 02 06:11:34 CST 2004

02.11.2004 08:39, Ken Kazinski schrieb:

> I would like to run a script and have it open a Command/DOS window and send
> all its outputs to the window. Is there a easy way to do this?

Use WScript.Echo for Output and run the script with cscript.exe.

--
Gruesse, Christoph

Rio Riay Riayo - Gordon Sumner, 1979

Re: Attaching A Dos Window by Ulf

Ulf
Tue Nov 02 07:22:48 CST 2004

Hi Ken,

Maybe the exec method of the wscript.shell object will help you. The
returned object has methods like stdin and stdout.

Do something like this:

Set sh = CreateObject("WScript.Shell")
Set cmd = sh.Exec("%comspec% /k")
cmd.StdIn.Write "blabla"

Although this script is not working as expected (<g>) it maybe a good
starting point at least.

Ulf

Ken Kazinski wrote:
> I would like to run a script and have it open a Command/DOS window
> and send all its outputs to the window. Is there a easy way to do
> this?



RE: Attaching A Dos Window by KenKazinski

KenKazinski
Sat Nov 06 06:58:02 CST 2004

I do not want to use cscript.exe because then I need a second bat file to run
the script. I want the user to be able to click on the script file and have
it provide the output.

Ulf - nothing gets printed to the window when I use the example you have
provided.

Ken


Re: Attaching A Dos Window by Michael

Michael
Sat Nov 06 12:06:33 CST 2004

Ken Kazinski wrote:
> I do not want to use cscript.exe because then I need a second bat
> file to run the script. I want the user to be able to click on the
> script file and have it provide the output.
>
> Ulf - nothing gets printed to the window when I use the example you
> have provided.

Most people solve this problem using IE automation.

I donated a generic msg.wsc wrapper for this purpose back in April 2000.

Google Search: "msg.wsc" site:cwashington.netreach.net
http://www.google.com/search?q="msg.wsc"%20site:cwashington.netreach.net&num=100&scoring=d


--
Michael Harris
Microsoft.MVP.Scripting
Sammamish WA US