O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Microsoft® WSH and VBScript Programming for the Absolute Beginner, Fourth Edition

Book Description

VBScript is a programming language that is simple enough for beginners and makes learning fundamental programming concepts easy. But as you'll learn in this updated fourth edition of MICROSOFT WSH AND VBSCRIPT PROGRAMMING FOR THE ABSOLUTE BEGINNER, VBScript is also a powerful scripting language through which you can learn even the most advanced programming concepts. No complex programming environment is required: You can create VBScripts using a simple text editor such as Windows Notepad, and VBScripts can be run on WSH (Windows Script Host) and several other environments. If you are new to programming with Microsoft WSH and VBScript and are looking for a solid introduction, this is the book for you. This revised fourth edition covers WSH 5.7 and VBScript 5.7. Get started programming today, with MICROSOFT WSH AND VBSCRIPT PROGRAMMING FOR THE ABSOLUTE BEGINNER, FOURTH EDITION

Table of Contents

  1. Title Page
  2. Copyright Page
  3. Dedication
  4. Acknowledgments
  5. About the Author
  6. Table of Contents
  7. Introduction
  8. PART I Introducing the WSH and VBScript
    1. 1 Getting Started with the WSH and VBScript
      1. Project Preview: The Knock Knock Game
      2. What Is the WSH?
      3. Introducing VBScript
      4. Back to the Knock Knock Game
      5. Summary
    2. 2 An Introduction to the Windows Script Host
      1. Project Preview: The Rock, Paper, and Scissors Game
      2. Examining Scripting Environments
      3. An Examination of WSH Components
      4. Configuring WSH Execution Hosts
      5. Back to the Rock, Paper, and Scissors Game
      6. Summary
  9. PART II Learning VBScript and WSH Scripting
    1. 3 VBScript Basics
      1. Project Preview: The Math Game
      2. VBScript Statements
      3. VBScript Syntax Rules
      4. Mastering the VBScript Object Model
      5. Working with VBScript Run-Time Objects
      6. Using VBScript Run-Time Objects in Your Scripts
      7. Examining Built-in VBScript Functions
      8. Displaying Script Output
      9. Back to the Math Game
      10. Summary
    2. 4 Constants, Variables, Arrays, and Dictionaries
      1. Project Preview: The Story of Captain Adventure
      2. Understanding How Scripts View Data
      3. Working with Data That Never Changes
      4. Storing Data That Changes During Script Execution
      5. Working with Collections of Related Data
      6. Storing Data in Dictionaries
      7. Processing Data Passed to a Script at Run-Time
      8. Back to the Story of Captain Adventure
      9. Summary
    3. 5 Conditional Logic
      1. Project Preview: The Planet Trivia Quiz Game
      2. Examining Program Data
      3. Performing More Complex Tests with VBScript Operators
      4. Back to the Planet Trivia Quiz Game
      5. Summary
    4. 6 Processing Collections of Data
      1. Project Preview: The Guess a Number Game
      2. Adding Looping Logic to Scripts
      3. Back to the Guess a Number Game
      4. Summary
    5. 7 Using Procedures to Organize Scripts
      1. Project Preview: The BlackJack Lite Game
      2. Improving Script Design with Procedures
      3. Working with Built-in VBScript Functions
      4. Limiting Variable Scope with Procedures
      5. Back to the BlackJack Lite Game
      6. Summary
  10. PART III Advanced Topics
    1. 8 Storing and Retrieving Data
      1. Project Preview: The Lucky Lottery Number Picker
      2. Working with the Windows File System
      3. Opening and Closing Files
      4. Writing to Files
      5. Reading from Files
      6. Managing Files and Folders
      7. Storing Script Configuration Settings in External Files
      8. Back to the Lucky Lottery Number Picker
      9. Summary
    2. 9 Handling Script Errors
      1. Project Preview: The Hangman Game
      2. Understanding VBScript Errors
      3. Dealing with Errors
      4. Reporting Errors
      5. Back to the Hangman Game
      6. Summary
    3. 10 Using the Windows Registry to Configure Script Settings
      1. Project Preview: Part 2 of the Hangman Game
      2. Introducing the Windows Registry
      3. Accessing Registry Keys and Values
      4. Creating a Key and Value to Store Script Settings
      5. Back to Part 2 of the Hangman Game
      6. Summary
    4. 11 Working with Built-in VBScript Objects
      1. Project Preview: The Tic Tac Toe Game
      2. Leveraging VBScript’s Built-in Collection of Objects
      3. Creating Custom Objects
      4. Working with the Err Object
      5. Working with Regular Expressions
      6. Back to the Tic Tac Toe Game
      7. Summary
    5. 12 Combining Different Scripting Languages
      1. Project Preview: The VBScript Game Console
      2. Introducing Windows Script Files
      3. Back to the VBScript Game Console
      4. Summary
    6. 13 Working with the Windows Management Instrumentation
      1. Introducing the Windows Management Instrumentation
      2. WMI Infrastructure Overview
      3. Scripting the WMI
      4. Summary
    7. 14 Adding a GUI to Your Scripts
      1. Project Preview: The HTA Rock, Paper, Scissors Game
      2. Introducing HTML Applications (HTAs)
      3. How Do HTAs Compare to HTML Pages?
      4. Creating and Executing an HTA
      5. Constructing an HTA
      6. Adding Interface Elements
      7. Integrating WSH into Your HTAs
      8. Back to the Rock, Paper, Scissors Game
      9. Summary
  11. PART IV Appendices
    1. Appendix A WSH Administrative Scripting
      1. Desktop Administration
      2. Network Administration
      3. Printer Administration
      4. Computer Administration
      5. Disk Management
      6. Integrating VBScript with Other Applications
      7. HTML Applications
    2. Appendix B Introducing Remote WSH
      1. Introducing Remote WSH
      2. Understanding Remote WSH’s Supporting Architecture
      3. Working with Remote WSH: A Demonstration
    3. Appendix C The WSH Core Object Model
      1. WSH Objects and Their Properties and Methods
    4. Appendix D Built-in VBScript Functions
    5. Appdndix E What’s on the Companion Website?
      1. Script Examples
  12. Index