Synopses & Reviews
Automate Windows system administration, application control, file management, and more!
- Scripting solutions for Windows 2000, Windows 9x, and Windows ME
- Covers both VBScript and JScript
- Step-by-step coverage of cre ating, running, scheduling, and distributing scripts
- System administration, application control, file management, messaging, database access, and more
- Creating high-performance WSH script components
- Covers both VBScript and J Script!
- Syntax, data storage, operators, strings, dates, times, objects, error handling, and more
- Automating system administration, file management, database access, and messaging
- Creating high-performance WSH components
- Extending Windows' power by scripting Microsoft Office components
- Appendices include detailed VBScript and JScript references
- For every intermediate to advanced-level Windows user and administrator
Microsoft's W indows Script Host (WSH) offers system administrators and users powerful opportunities to save time and improve efficiency. In Windows Script Host, expert developer and best-selling author Peter G. Aitken covers WSH from start to finish, giving you all the skills you need to automate a wide range of system, application, and file-related tasks on Windows ME/9x and Windows 2000/NT platforms.
Aitken offers in-depth coverage of both widely used WSH scripting languages VBScript and JSc ript. You'll start by mastering the Windows file system and scripting object models. Next, you'll learn the most effective ways to run, schedule, and distribute scripts. Once you've mastered the basics, Aitken presents practical techniques for scripting v irtually every aspect of the Windows environment, from messaging to file management, database access to system and Web administration.
Aitken presents step-by-step coverage of testing and debugging WSH scripts, demonstrates how to create fast, efficient Windows Script Components, and even shows how to extend Windows' power by scripting Microsoft Office components.
WSH gives you greater control over Windows than ever before. With Peter G. Aitken's help, you'll master that powerand dynamically improve your productivity every day you run Windows!
About the Author
PETER G. AITKEN is a well-known author specializing in computer programming, applications, and hardware. His 30 books include Developing Custom Solutions With Office 2000 Components and VBA (Prentice Hall), Teach Yourself C in 21 Days, and Visual Basic 6 Programming Blue Book. A long-time faculty member at Duke University, he owns PGA Consulting, a custom software developer for industry and academia.
Table of Contents
(NOTE: Each chapter ends with Overview.)
1. Windows Script Host Fundamentals.
Background. Unix Scripting. The DOS Batch Language. Windows Scripting. How WSH Works. What Can WSH Do? WSH Operation. Scripting Technology. Two Scripting Utilities. WSH Languages. WSH and Objects.
2. The WSH Object Model.
Objects. Object References. Object Properties. Object Methods. Collections. The WshCollection Object. The FileSystemObject. The Dictionary Object. The Wscript Object. Obtaining Host Information. Script Interactivity. Terminating a Script. Setting a Timeout. Working with Objects. The WshShell Object. The WshEnvironment Object. The WshSpecialFolders Object. Working with Shortcuts. Displaying Popup Messages. Working with the Registry. Running Programs. The WshNetwork Object. Obtaining User Information. Working with Printers. Managing Network Drives.
3. Creating, Running, and Scheduling Scripts.
Creating Your Scripts. Online Documentation. Running Scripts. Script Shortcuts. Scheduling Scripts.
4. Working with Script Arguments, .WSH Files, and Web.
Scripting. Script Arguments. WSH Files. WSH and Web Scripting.
5. Testing and Debugging Your Scripts.
Catching Script Errors. Syntax Errors. Run-Time Errors. Bugs. Debugging Your Scripts. The Script Debugger. Using the Debugger.
6. VBScript: Syntax, Data Storage, and Operators.
Introduction to VBScript. Comparison with Visual Basic. Syntax Fundamentals. Comments. Line Continuations. Data Storage. Object References. Determining Data Type. Arrays. Static Arrays. Dynamic Arrays. Variant Arrays. Operators. Assignment Operator. Arithmetic Operators. String Operators. Comparison Operators. Logical Operators. Operator Precedence and Parentheses.
7. VBScript: Program Control and Procedures.
Conditional Statements. If… Then… Else. Select Case. Loop Statements. For…. Next. For Each… Next. Do…Loop. While…Wend. Infinite Loops. Procedures. Types of Procedures. Defining a Procedure. Passing Arguments to Procedures. Variables in Procedures. Calling Procedures.
8. VBScript: Working with Text, Numbers, Dates, and Times.
Text Manipulation. Asc. Chr. Filter. InStr, InStrRev. InStrRev. Join. LCase, Ucase. Left, Mid, Right. Len. LTrim, RTrim, Trim. Mid (function). RegExp. Right. Rtrim. Space. Split. String. StrComp. Trim. Ucase. Working With Numbers. Using Dates and Times. Date and Time Representation. Getting the Current Date and Time. Creating Dates and Times. Adding and Subtracting Dates and Times. Getting Date and Time Information. Formatting Dates and Times.
9. VBScript: User Interaction, Error Handling, And Miscellaneous Topics.
Interacting with the User. The MsgBox Function. InputBox. Error Handling. Other Topics. Eval. Execute and ExecuteGlobal.
10. JScript: Basic Syntax, Data Storage, and Operators.
Introduction to Jscript. Comparison with Java. Syntax Fundamentals. Comments. Data Storage. Constants. Variables. Data Types and Coersion. Object References. Arrays. JScript Operators. The Assignment Operators. The Arithmetic Operators. The Increment and Decrement Operators. The Comparison Operators. The Logical Operators. String Operators. Conditional Expressions. Operator Precedence and Parentheses.
11. JScript: Conditional Statements, Loops, and Functions.
Conditional Statements. If…Else. Switch. Loop Statements. For. While. Do…While. The Continue Statement. The With Statement. Functions. Defining a Function. Variables in Functions. Calling a Function.
12. JScript: Strings, Numbers, Math, Dates, and Times.
The String Object. The Split Method. Working with Regular Expressions. The Number Object. The Math Object. Dates and Times.
13. JScript: Built-in Objects, User Interaction, and Error Handling.
JScript Objects. The Boolean Object. The Enumerator Object. The Function Object. The VBArray Object. User Interaction. Error Handling. The Error Object. Try…Catch. The Throw Statement.
14. WSH 2.0 and WSF Files.
Using WSF Files. XML and WSF Files. The