Microsoft Windows Script Host 2.0 Developer's Guide

Since the release of Microsoft Windows 98, Windows Script Host (WSH) has become increasingly popular as a tool for automating routine, daily PC tasks to save time and effort. But learning how to script with WSH has been difficult because of a lack of good documentation-until now. MICROSOFT WINDOWS SCRIPT HOST 2.0 DEVELOPER'S GUIDE is the complete guide to automating routine Windows tasks. It covers all major features of Windows Script Host, as well as related topics such as how to access other automation objects. This book is ideal for WSH novices with basic programming knowledge, Microsoft Visual Basic(r) programmers, and programming experts who want to create WSH scripts to simplify working with their PCs.

  Who This Book Is For
  The Scope of This Book
  Further Reading
  System Requirements
Part I: Introduction to the World of Script Programming
  Chapter 1 -- Introduction to Windows Script Host
    What You Can Do with WSH Scripts
    Upgrading to WSH 2
    Creating and Using Scripts
  Chapter 2 -- Development Tools and Techniques
    Creating Scripts
    Editing Scripts
    Installing and Uninstalling ActiveX Controls
    Debugging Scripts
  Chapter 3 -- Introduction to Programming with Objects
    Available Objects
  Chapter 4 -- Introduction to VBScript
    Basic Features
    Advanced Features
  Chapter 5 -- Introduction to JScript
    What Is JScript?
    The Structure of a JScript Program
    Control Structures
    Functions and Objects
Part II: Interactive Scripting
  Chapter 6 -- Creating Simple Dialog Boxes in WSH
    Using the Echo Method
    Using the MsgBox Function in VBScript
    Using the Popup Method
  Chapter 7 -- Working with WSH Objects
    Using the WScript Object
    Accessing Environment Variables
    Creating and Releasing Objects
    Launching Other Programs form a Script
  Chapter 8 -- Retrieving User Input in WSH Scripts
    Invoking an Input Dialog Box in WSH Script
    Invoking an Input Dialog Box in JScript
  Chapter 9 -- Working with Forms
    Using Internet Explorer to Create an About Dialog Box
    Using Internet Explorer and WSH to Create a Form
Part III: Power Scripting
  Chapter 10 -- Creating Shortcuts
    Shortcut Basics
    Shortcuts: Beyond the Basics
  Chapter 11 -- Using Advanced WSH Features
    Retrieving the User, Domain, or Computer Name
    Connecting to a Network Printer
    Mapping Network Printer
    Accessing the Windows Registry
  Chapter 12 -- Using File System and I/O Commands
    The FileSystemObject Object Model
    Accessing Drives
    Accessing Files and Folders
    Accessing Text Files
    Using the Browse For Folder Dialog Box
  Chapter 13 -- Controlling Windows and Applications from Scripts
    Delaying Script Execution
    Activating an Application Using the AppActivate Method
    Using the SendKeys Method to Simulate Keystrokes
    Customizing Windows Using Logon Scripts
  Chapter 14 -- Programming Techniques and Tips
    Run-Time Errors
    Paths and Dates
    Long Filenames, the At Command, and System Calls
    User Dialog Boxes and Output
    File Handling
    Playing Sound
    The Windows Shell
    Calling a DUN Connection
Part IV: Appendixes
  Appendix A -- WSH Resources on the Internet
  Appendix B -- Script Security
    Partially Disabling WSH
    Preventing Automatic Execution of WSH Scripts
    Security Settings for WSH Scripts
    Concluding Remarks
About the Author
About This Electronic Book