Winscripter
  WSH
  Forums
  Downloads
  Books
  Links
  Amazon




Login
Register

© winscripter.com
1998-2004







Use Echo to display data to user

Posted by on Saturday, January 17, 2004 (PST)

Use WScript.Echo to display information to the user. WScript.Echo will display a popup when run under WScript and will print to the console when run under CScript.

Using the built in Object Echo you can quickly and easily display information to your user. Unlike the Popup Object, using Echo can display information in both CScript and WScript.

Use of Echo is simple, so I will get right into a couple of Examples.

 


// a must!
WScript.Echo("Hello World"); 
  
// on two lines.
WScript.Echo("Hello\nWorld");
// using a variable.
var msg = "Hello World";
WScript.Echo( msg );      
// using a variable and a string
WScript.Echo( msg + "\nGoodbye World");
// Finish
WScript.Echo("Finished!");

 
 


 


Add Your Comment



WSH and ADSI Administrative Scripting

New Articles
  • List installed COM objects and associated ProgIDs
    Script: Lists all COM Objects and their associated ProgIDs (If available). Win32_ClassicCOMClassSetting

  • Script: File Rotator
    Script: Rotate files where the most current file has the lowest number in the archive. When files exceed the retention period, they are deleted. Typically used for log files, backups, etc..

  • Script: Create IIS Website and DNS record
    Script: Dan Casier sent me this script that will create a website and appropriate DNS record. The script is intended for Windows 2000 Server with local DNS and necessary DNS mof installed.


  • Winscripter   |  WSH   |  Forums   |  Downloads   |  Books   |  Links   |  Amazon