Book description
Completely updated for Windows Vista and Windows Server 2003 R2, this book is packed with practical examples for today's programmer, Web developer, or system administrator
Combines a comprehensive overview of the VBScript technology and associated technologies with sample code at every stage from beginner to advanced user
Discusses the general syntax, functions, keywords, style, error handling, and similar language-specific topics and then moves into an expanded reference section covering the object models in detail
Presents advanced coverage on Active Directory Service Interfaces (ADSI), PowerShell, security scripting, remote scripting, database scripting, and more
Table of contents
- Copyright
- About the Authors
- Credits
- Acknowledgments
- Introduction
-
1. A Quick Introduction to Programming
- 1.1. Variables and Data Types
- 1.2. Flow Control
- 1.3. Operators and Operator Precedence
- 1.4. Organizing and Reusing Code
- 1.5. Top-Down versus Event-Driven
-
1.6. Coding Guidelines
- 1.6.1. Expect the Unexpected
- 1.6.2. Always Favor the Explicit over the Implicit
- 1.6.3. Modularize Your Code into Procedures, Modules, Classes, and Components
- 1.6.4. Use the "Hungarian" Variable Naming Convention
- 1.6.5. Don't Use One Variable for More Than One Job
- 1.6.6. Always Lay Out Your Code Properly
- 1.6.7. Use Comments to Make Your Code More Clear and Readable, but Don't Overuse Them
- 1.7. Summary
-
2. What VBScript Is — and Isn't!
- 2.1. Windows Script
- 2.2. Version Information
- 2.3. VBScript Is a Subset of VB
- 2.4. VBScript Is a Scripting Language
- 2.5. VBScript Is Interpreted at Runtime
- 2.6. Advantages of Using VBScript
- 2.7. Is VBScript Right for You?
- 2.8. How VBScript Fits in with the Visual Basic Family
- 2.9. What Can You Do with VBScript?
- 2.10. Tool of the Trade — Tools for VBScript
- 2.11. Summary
-
3. Data Types
- 3.1. Scripting Languages as Loosely Typed
- 3.2. Why Data Types Are Important
- 3.3. The Variant: VBScript's Only Data Type
- 3.4. Arrays as Complex Data Types
- 3.5. Summary
- 4. Variables and Procedures
- 5. Control of Flow
-
6. Error Handling and Debugging
- 6.1. Types of Errors
- 6.2. Error Visibility and Context
- 6.3. Handling Errors
- 6.4. Generating Custom Errors
-
6.5. Debugging
- 6.5.1. What Is a Debugger?
- 6.5.2. VBScript Debugging Scenarios
- 6.5.3. Debugging WSH Scripts with the Microsoft Script Debugger
- 6.5.4. Debugging Client-Side Web Scripts with the Microsoft Script Debugger
- 6.5.5. Debugging ASP with the Microsoft Script Debugger
- 6.5.6. Debugging without a Debugger
- 6.5.7. Using the Microsoft Script Debugger
- 6.6. Summary
- 7. The Scripting Runtime Objects
- 8. Classes in VBScript (Writing Your Own COM Objects)
-
9. Regular Expressions
- 9.1. Introduction to Regular Expressions
- 9.2. The RegExp Object
- 9.3. The Matches Collection
- 9.4. A Few Examples
- 9.5. Summary
- 10. Client-Side Web Scripting
- 11. Windows Sidebars and Gadgets
-
12. Task Scheduler Scripting
- 12.1. Working with Task Scheduler
-
12.2. Task Scheduler 2.0 Scripting Objects
- 12.2.1. Action
- 12.2.2. ActionCollection
- 12.2.3. BootTrigger
- 12.2.4. ComHandlerAction
- 12.2.5. DailyTrigger
- 12.2.6. EmailAction
- 12.2.7. EventTrigger
- 12.2.8. ExecAction
- 12.2.9. IdleSettings
- 12.2.10. IdleTrigger
- 12.2.11. LogonTrigger
- 12.2.12. MonthlyDOWTrigger
- 12.2.13. MonthlyTrigger
- 12.2.14. NetworkSettings
- 12.2.15. Principal
- 12.2.16. RegisteredTask
- 12.2.17. RegisteredTaskCollection
- 12.2.18. RegistrationInfo
- 12.2.19. RegistrationTrigger
- 12.2.20. RepetitionPattern
- 12.2.21. RunningTask
- 12.2.22. RunningTaskCollection
- 12.2.23. SessionStateChangeTrigger
- 12.2.24. ShowMessageAction
- 12.2.25. TaskDefinition
- 12.2.26. TaskFolder
- 12.2.27. TaskFolderCollection
- 12.2.28. TaskNamedValuePair
- 12.2.29. TaskNamedValueCollection
- 12.2.30. TaskService
- 12.2.31. TaskSettings
- 12.2.32. TaskVariables
- 12.2.33. TimeTrigger
- 12.2.34. Trigger
- 12.2.35. TriggerCollection
- 12.2.36. WeeklyTrigger
- 12.3. Sample Task Scheduler Script
- 12.4. Summary
- 13. PowerShell
-
14. Super-Charged Client-Side Scripting
- 14.1. Requirements and Browser Security
- 14.2. Scriptlets — Ancestors of Behaviors
- 14.3. Event Management
- 14.4. Scriptlets Are Deprecated in IE5
-
14.5. HTML Components (HTCs)
-
14.5.1. Extending HTML Elements Behavior
- 14.5.1.1. Enhancement 1: Adding Properties
- 14.5.1.2. Enhancement 2: Adding Methods
- 14.5.1.3. Enhancement 3: Exposing Component Events
- 14.5.1.4. Enhancement 4: Handling HTML Element Events
- 14.5.1.5. Attach Event Handlers Through Scripting
- 14.5.1.6. Multiple Behaviors
- 14.5.1.7. Name Clashing Resolution and the Component Element
-
14.5.1. Extending HTML Elements Behavior
- 14.6. Summary
-
15. Windows Script Host
- 15.1. Tools of the Trade
- 15.2. What Is WSH?
- 15.3. Types of Script Files
- 15.4. Running Scripts with the Windows Script Host
- 15.5. Using .WSH Files to Launch Scripts
-
15.6. Windows Script Host Intrinsic Objects
- 15.6.1. The WScript Object
- 15.6.2. The WshArguments Object
- 15.6.3. The WshShell Object
- 15.6.4. The WshNamed Object
- 15.6.5. The WshUnnamed Object
- 15.6.6. The WshNetwork Object
- 15.6.7. The WshEnvironment Object
- 15.6.8. The WshSpecialFolders Object
- 15.6.9. The WshShortcut Object
- 15.6.10. The WshUrlShortcut Object
- 15.7. Summary
-
16. Windows Script Components
- 16.1. What Are Windows Script Components?
- 16.2. What Tools Do You Need?
- 16.3. The Script Component Runtime
- 16.4. Script Component Files and Wizard
- 16.5. Exposing Properties, Methods, and Events
- 16.6. Registration Information
- 16.7. Creating the Script Component Type Libraries
- 16.8. How to Reference Other Components
- 16.9. Script Components for ASP
- 16.10. Compile-Time Error Checking
- 16.11. Using VBScript Classes in Script Components
- 16.12. Summary
- 17. Script Encoding
- 18. Remote Scripting
- 19. HTML Applications
-
20. Server-Side Web Scripting
- 20.1. Understanding the Anatomy of the HTTP Protocol
- 20.2. Introducing Active Server Pages
-
20.3. Using the Active Server Pages Object Model
- 20.3.1. Collections
- 20.3.2. The Request Object's Collection
- 20.3.3. The Response Object's Collection
- 20.3.4. The Response Object's Properties
- 20.3.5. Understanding the Application and Session Objects
- 20.3.6. The Application Object
- 20.3.7. The Session Object
- 20.3.8. The Server Object
- 20.3.9. The ObjectContext Object
- 20.4. Using Active Server Pages Effectively
- 20.5. Summary
-
21. Adding VBScript to Your VB and .NET Applications
- 21.1. Why Add Scripting to Your Application?
- 21.2. Macro and Scripting Concepts
- 21.3. Adding the Script Control to a VB 6 or .NET Application
- 21.4. Script Control Reference
- 21.5. Error Handling with the Script Control
- 21.6. Debugging
- 21.7. Using Encoded Scripts
- 21.8. Sample .NET Project
- 21.9. Sample Visual Basic 6 Project
- 21.10. Summary
-
A. VBScript Functions and Keywords
- A.1. Operators
- A.2. Date and Time Functions and Statements
- A.3. Unsupported Date Functions and Statements
- A.4. Array Functions and Statements
- A.5. String Functions and Statements
- A.6. Unsupported String Functions, Statements, and Constructs
- A.7. String Constants
- A.8. Conversion Functions
- A.9. Unsupported Conversion Functions
- A.10. Miscellaneous Functions, Statements, and Keywords
- B. Variable Naming Convention
- C. Coding Conventions
- D. Visual Basic Constants Supported in VBScript
- E. VBScript Error Codes and the Err Object
- F. The Scripting Runtime Library Object Reference
-
G. The Windows Script Host Object Model
- G.1. The Scripting.Signer Object
- G.2. The WScript Object
- G.3. The WshArguments Object
- G.4. WshController Object
- G.5. WshEnvironment Object
- G.6. WshNamed Object
- G.7. The WshNetwork Object
- G.8. WshRemote Object
- G.9. WshRemoteError Object
- G.10. WshScriptExec Object
- G.11. The WshShell Object
- G.12. The WshShortcut Object
- G.13. The WshSpecialFolders Object
- G.14. The WshUnnamed Object
- G.15. The WshUrlShortcut Object
- H. Regular Expressions
- I. The Variant Subtypes
- J. ActiveX Data Objects
Product information
- Title: VBScript Programmer's Reference, Third Edition
- Author(s):
- Release date: October 2007
- Publisher(s): Wrox
- ISBN: 9780470168080
You might also like
book
Programming Microsoft® ASP.NET 4
Completely reengineered for ASP.NET 4—this definitive guide deftly illuminates the core architecture and programming features of …
book
VBScript Pocket Reference
Microsoft's Visual Basic Scripting Edition (VBScript), a subset of Visual Basic for Applications, is a powerful …
book
VBScript in a Nutshell
Microsoft's Visual Basic Scripting Edition (VBScript), a subset of Visual Basic for Applications, is a powerful …
book
ASP in a Nutshell, 2nd Edition
ASP in a Nutshell provides the high-quality reference documentation that web application developers really need to …