[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6575
  • Last Modified:

Redirect WScript.Echo Output

New to scripting, how can I redirect the output from a message box to a file?  The following code displays a message box for each element of the array.  I'd like to capture it in a file.

WScript.Echo "Members:"
For Each strMember in arrMemberOf
  WScript.Echo strMember

Thank you
1 Solution
You can use these lines in order to write to a text file:


  Set fso = CreateObject("Scripting.FileSystemObject")
  Set file = fso.CreateTextFile("c:\newfile.txt", True)
  file.WriteLine whatever


Replace "whatever" with any text you want to write!

  Nayer Naguib
MariaHaltAuthor Commented:
Perfect!  Thank you!!!

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now