WSH output to console 
Author Message
 WSH output to console

How is it done?

Thanks,

Dayal



Thu, 10 May 2001 03:00:00 GMT  
 WSH output to console
Use CSCRIPT.EXE to run the script, then use the:

WScript.Echo "This is a test"

See Ya



Quote:
>How is it done?

>Thanks,

>Dayal



Thu, 10 May 2001 03:00:00 GMT  
 WSH output to console
Wscript.Echo is one way, but you can also use the FileSystemObject and open
a textstream on the CON or CONOUT$ devices.

--
Tim Hill -- Windows NT MVP

(Pursuant to US Code, Title 47, Chapter 5, Subchapter II, 227, any and all
nonsolicited commercial E-mail sent to this address is subject to a download
and archival fee in the amount of $1000 US.  E-mailing denotes acceptance of
these terms.)


Quote:
>How is it done?

>Thanks,

>Dayal



Thu, 10 May 2001 03:00:00 GMT  
 WSH output to console

From the DOC there are several ways.

The Echo method displays parameters in a window (in Wscript.exe) or at the command prompt in a Command Prompt window (in Cscript.exe).

Parameters are delimited by one space. Under Cscript.exe, this method outputs a carriage-return/line feed pair (CR LF) after the last parameter displayed.

Syntax
Wscript.Echo [anyArg...]

Example
Wscript.Echo
Wscript.Echo 1, 2, 3
Wscript.Echo "Windows Scripting Host is cool."

Or you can use the WshShell.popup method for Wscript
The Popup method displays a popup message box window that contains the message contained in strText. The window title of this message box is specified by strTitle. If strTitle is omitted, the window title is "Windows Scripting Host".

Syntax
WshShell.Popup(strText, [natSecondsToWait], [strTitle], [natType]) = intButton

Remarks
If natSecondsToWait is supplied and its value is greater than zero, the message box window will be closed after natSecondsToWait seconds.

The meaning of natType is the same as in the Win32? MessageBox function. The following table shows the value and its meaning in natType. You can combine values in the following tables.

Button Types
Value Description
            0 Show [OK] button
            1 Show [OK] and [Cancel] buttons
            2 Show [Abort], [Retry] and [Ignore] buttons
            3 Show [Yes], [No] and [Cancel] buttons
            4 Show [Yes] and [No] buttons
            5 Show [Retry] and [Cancel] buttons

Icon Types
Value Description
            16 Show "Stop Mark" icon
            32 Show "Question Mark" icon
            48 Show "Exclamation Mark" icon
            64 Show "Information Mark" icon

The preceding two tables do not cover all values for natType. For a complete list, see the Win32 documentation.

The return value intButton denotes the number of the button that the user clicked. If the user does not click a button before natSecondsToWait seconds, intButton is set to -1.

Value Description
            1 [OK] button
            2 [Cancel] button
            3 [Abort] button
            4 [Retry] button
            5 [Ignore] button
            6 [Yes] button
            7 [No] button

Example
Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Popup "Where do you want to go today?"

Regards,
Ian
WSH FAQ http://wsh.glazier.co.nz/frame.htm

Quote:
>How is it done?

>Thanks,

>Dayal



Fri, 11 May 2001 03:00:00 GMT  
 WSH output to console
Hello,

 can you provide an example please?? I tried it, with no success. In much
cases it would be very usefule to redirect the output into a pipe, so that
"find" can extract something from the output. It this possible this way??

Manfred Braun
SCA Packaging Deutschland
Headoffice IS Systems

Tim Hill/MVP schrieb in Nachricht

Quote:
>Wscript.Echo is one way, but you can also use the FileSystemObject and open
>a textstream on the CON or CONOUT$ devices.

>--
>Tim Hill -- Windows NT MVP

>(Pursuant to US Code, Title 47, Chapter 5, Subchapter II, 227, any and all
>nonsolicited commercial E-mail sent to this address is subject to a
download
>and archival fee in the amount of $1000 US.  E-mailing denotes acceptance
of
>these terms.)


>>How is it done?

>>Thanks,

>>Dayal



Sun, 13 May 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Windows 2000 console output

2. Redirect console output?

3. Grabbing DOS console output

4. Chaining console output using CScript.exe

5. Problems with console output handling

6. Output to console

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

8. how to capture console output on client window.

9. Sending JScript output to the Java console

10. running console app in same console

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

12. Locking the Console from WSH (VBScript)

 

 
Powered by phpBB® Forum Software