Echo a text string to the screen (cscript) or a dialogue box (wscript)

Syntax 
      WScript.Echo [Arg1] [,Arg2] [,Arg3] ... 

Arguments:
         Arg1, Arg2, Arg3 ... Optional string values to be displayed.
                              If no arguments are provided a 
                              blank line is output.
Examples
  WScript.Echo "Hello"
  WScript.Echo

  Set objNet = WScript.CreateObject("WScript.Network")
  WScript.Echo "Your Computer Name is " & objNet.ComputerName
  WScript.Echo "Your Username is " & objNet.UserName

An alternative is to use Active Directory:

  Set objAD = CreateObject("ADSystemInfo")
  Wscript.Echo "Your Computer Name is " & objAD.ComputerName
  Wscript.Echo "Your Username is " & objAD.UserName 

ECHO can be suppressed by setting .Interactive to false
e.g.
  WScript.Echo("Hello")
  WScript.Interactive = false
  WScript.Echo("This wont display")
  WScript.Interactive = true
  WScript.Echo("This will display")
Advertisements