Is it posible to hide a console window started with the Exec method? 
Author Message
 Is it posible to hide a console window started with the Exec method?

Did anyone ever determine how to use the Exec method so the resulting
console window is hidden?

I'm running the script at the bottom within an HTA; whenever it executes, I
get an ugly command shell window popping up until it finishes.

I saw a discussion that apparently *started* on this topic back in May, but
got sidetracked into issues with using "Run" (which is not an option since I
want to use StdOut).

========Relevant sections of my script below =============
==============================================
set objShell = CreateObject("WScript.Shell")
...
 sub traceroute
  cmdline="cmd /c tracert " & inTrace.value
  set objExCmd = objShell.Exec(cmdline)
  outLog.value=outLog.value & vbCRLF & objExCmd.StdOut.ReadAll
 end sub
--
==============================
Nyrk Natrybcbhybf

ZPFR, ZPC+V, AGPVC
(Try ROT thir{*filter*})
==============================



Mon, 26 Apr 2004 02:42:42 GMT  
 Is it posible to hide a console window started with the Exec method?
Never mind... Just found the post on [sic] "Mimimizing WshScriptExec
Windows"...

===============================================================
Nope...

If the script is executed via cscript.exe you won't get a secondary console
window (it will share
the existing console window).  But if you execute via wscript.exe, there
isn't any way to suppress
or otherwise hide that console window.

--

Michael Harris
Microsoft.MVP.Scripting
--

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

Quote:
> Is there a way to mimimize a shell window that is running a
"WshShell.Exec"
> process?  (Like the intWindowStyle parameter for the Run command.)

> Thanks,

> --
> Bill Watkins
> Applications Architect
> Information Systems
> Boeing Houston Operations



Mon, 26 Apr 2004 02:50:46 GMT  
 Is it posible to hide a console window started with the Exec method?

Quote:
>-----Original Message-----
>Did anyone ever determine how to use the Exec method so
the resulting
>console window is hidden?

>I'm running the script at the bottom within an HTA;

whenever it executes, I
Quote:
>get an ugly command shell window popping up until it
finishes.

>I saw a discussion that apparently *started* on this

topic back in May, but
Quote:
>got sidetracked into issues with using "Run" (which is

not an option since I
Quote:
>want to use StdOut).

>========Relevant sections of my script below =============
>==============================================
>set objShell = CreateObject("WScript.Shell")
>....
> sub traceroute
>  cmdline="cmd /c tracert " & inTrace.value
>  set objExCmd = objShell.Exec(cmdline)
>  outLog.value=outLog.value & vbCRLF &

objExCmd.StdOut.ReadAll
Quote:
> end sub
>--
>==============================
>Nyrk Natrybcbhybf

>ZPFR, ZPC+V, AGPVC
>(Try ROT thir{*filter*})
>==============================

>Following is my script for this.... and i am a

real newbie, just started today on VBScript.
Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "c:\stxfw\uop\showlog.exe"
WScript.sleep 500
oShell.SendKeys "EXIT"
oShell.SendKeys "{ENTER}"
Set oShell = Nothing
Quote:
>.



Tue, 27 Apr 2004 04:34:45 GMT  
 Is it posible to hide a console window started with the Exec method?
I'm using the "Exec" method, not Run - has some handy features that you
can't access via "Run"...


Quote:

> >-----Original Message-----
> >Did anyone ever determine how to use the Exec method so
> the resulting
> >console window is hidden?

> >I'm running the script at the bottom within an HTA;
> whenever it executes, I
> >get an ugly command shell window popping up until it
> finishes.

> >I saw a discussion that apparently *started* on this
> topic back in May, but
> >got sidetracked into issues with using "Run" (which is
> not an option since I
> >want to use StdOut).

> >========Relevant sections of my script below =============
> >==============================================
> >set objShell = CreateObject("WScript.Shell")
> >....
> > sub traceroute
> >  cmdline="cmd /c tracert " & inTrace.value
> >  set objExCmd = objShell.Exec(cmdline)
> >  outLog.value=outLog.value & vbCRLF &
> objExCmd.StdOut.ReadAll
> > end sub
> >--
> >==============================
> >Nyrk Natrybcbhybf

> >ZPFR, ZPC+V, AGPVC
> >(Try ROT thir{*filter*})
> >==============================

> >Following is my script for this.... and i am a
> real newbie, just started today on vbscript.
> Dim oShell
> Set oShell = WScript.CreateObject ("WSCript.shell")
> oShell.run "c:\stxfw\uop\showlog.exe"
> WScript.sleep 500
> oShell.SendKeys "EXIT"
> oShell.SendKeys "{ENTER}"
> Set oShell = Nothing
> >.



Wed, 28 Apr 2004 03:42:35 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

2. how to hide the window that use the showModelessDialog() method to open

3. Stopping a hidden console application

4. Displaying Hidden Command Console Backgroud Process

5. Am I recursing something? - Using Shell's Exec in console

6. Can .Exec be called hidden?

7. How to wait for termination of program started with WshShell.Exec

8. Exec method

9. Help with Exec method

10. Exec Method Not Supported -- Wrong WSH Version?

11. Exec method with commands requiring input

12. No FTP output when launched with Exec method

 

 
Powered by phpBB® Forum Software