Skip to Content
Microsoft® Windows® Scripting Self-Paced Learning Guide
book

Microsoft® Windows® Scripting Self-Paced Learning Guide

by Ed Wilson
April 2004
Beginner
416 pages
11h 3m
English
Microsoft Press
Content preview from Microsoft® Windows® Scripting Self-Paced Learning Guide

Existential File Approaches

Although the approach to file management just discussed might seem laid back and groovy, in many environments, you need to take a more existential approach. In other words, you must first determine whether the file exists, and if it does, you want to append to the file (not overwrite it); if it does not exist, you want to create it. This ensures that your log file is present on each server running your script.

To check for the existence of a particular file, you use the FileExists method of FileSystemObject. Although it’s true that this method complicates the script a little, it’s also true that by checking for and creating a particular file as required, you add an order of magnitude to the flexibility of the script. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Windows® 2000 Scripting Guide

Microsoft® Windows® 2000 Scripting Guide

Microsoft Corporation
Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner

Publisher Resources

ISBN: 9780735619814Supplemental ContentCatalog PageErrata