Scripting School: Writing output to a text file

Christa Anderson

By writing the output of your scripts to a file, you can preserve important output instead of just echoing to the screen. You can display hard-coded text and variable values or you can even operate on variables and show the results in the text file.

And, of course, you can time-stamp the text file to show when you created it.

Scripting School: Writing output to a text file


Requires Free Membership to View


- Writing output to a file

- Using saved output

-  Summary


Read all of Christa's scripting columns:

A Terminal Services MVP, Christa Anderson is the strategic technology manager for visionapp She formerly was program manager for the Microsoft Terminal Services team. She is an internationally known authority on scripting, the author of Windows Terminal Services, The Definitive Guide to MetaFrame XP, and co-author of the book Mastering Windows 2003 Server. If you have a scripting question for Christa, please e-mail her at She often uses these emails as fodder for her scripting columns.

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: