Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:44:22+00:00 2026-06-14T08:44:22+00:00

We currently use Windows Batch (DOS) command files to control our process flow. To

  • 0

We currently use Windows Batch (DOS) command files to control our process flow. To display messages to the Console, we would use the ECHO command. These messages would show up in our Scheduler software, which used to be Tivoli and now is CA WA Workstation\ ESP.

I would like to start using VBS files instead of CMD\BAT files and am trying to figure out how to do the equivalent of an ECHO to the console.

When I try to use either the WScript.Echo command or write to Standard Out, the messages are displayed in dialog boxes for both and they require the OK button to be pushed to continue. Not surprisingly, when I run unattended though a scheduler, the job hits one of these commands and just hangs since there is no one to OK the messagebox.

SET FS = CreateObject("Scripting.FileSystemObject")
SET StdOut = FS.GetStandardStream(1)
StdOut.Write("Test 1")

WScript.echo("Test 2")

I realize I could write the messages to a Log file using the Scripting object, but this could fail if an invalid path is provided or because of insufficient permissions. Besides, being able to see feedback write within the Scheduler is awfully convenient.

How do I write to the Console using VBScript? I’ve seen other posts here that suggest that the above methods which didn’t work for the reason describe above were the way to do it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:44:23+00:00Added an answer on June 14, 2026 at 8:44 am

    wscript.echo is the correct command – but to output to console rather than dialogue you need to run the script with cscript instead of wscript.

    You can resolve this by

    • running your script from command line like so:

      cscript myscript.vbs
      
    • changing the default file association (or creating a new file extension and association for those scripts you want to run with cscript).

    • change the engine via the script host option (i.e. as per http://support.microsoft.com/kb/245254)

      cscript //h:cscript //s
      
    • Or you can add a few lines to the start of your script to force it to switch “engine” from wscript to cscript – see http://www.robvanderwoude.com/vbstech_engine_force.php (copied below):

      RunMeAsCScript
      
      'do whatever you want; anything after the above line you can gaurentee you'll be in cscript 
      
      Sub RunMeAsCScript()
              Dim strArgs, strCmd, strEngine, i, objDebug, wshShell
              Set wshShell = CreateObject( "WScript.Shell" )
              strEngine = UCase( Right( WScript.FullName, 12 ) )
              If strEngine <> "\CSCRIPT.EXE" Then
                      ' Recreate the list of command line arguments
                      strArgs = ""
                      If WScript.Arguments.Count > 0 Then
                              For i = 0 To WScript.Arguments.Count
                                      strArgs = strArgs & " " & QuoteIt(WScript.Arguments(i)) 
                              Next
                      End If
                      ' Create the complete command line to rerun this script in CSCRIPT
                      strCmd = "CSCRIPT.EXE //NoLogo """ & WScript.ScriptFullName & """" & strArgs
                      ' Rerun the script in CSCRIPT
                      Set objDebug = wshShell.Exec( strCmd )
                      ' Wait until the script exits
                      Do While objDebug.Status = 0
                              WScript.Sleep 100
                      Loop
                      ' Exit with CSCRIPT's return code
                      WScript.Quit objDebug.ExitCode
              End If
      End Sub
      
      'per Tomasz Gandor's comment, this will ensure parameters in quotes are covered:
      function QuoteIt(strTemp) 
              if instr(strTemp," ") then
                      strTemp = """" & replace(strTemp,"""","""""") & """"
              end if
              QuoteIt = strTemp
      end function
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently attempting to use the Windows Powerpack DataRepeater control to display data from
I currently use visual studio 2008 for creating projects that can run on windows.
I am building a DEV image and am currently planning to use Windows XP
Im currently updating and replacing old outdated nightly scheduled batch files with new self
Currently we use Boost in our SVN under a 3rd party directory. The problem
I'm trying to use openfiles.exe to grab the information of what files are currently
How do I capture/read DOS input for use in MsBuild? EDITED for clarification Currently
Is there a Windows command line command that I can use to get the
I currently use a Windows 7 Home Basic. I need to run a certain
We currently use SQL 2008 with Windows Authentication disabled, we only allow SQL Mixed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.