ebook img

Windows XP Under the Hood: Hardcore Windows Scripting and Command Line Power PDF

694 Pages·2002·3.89 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Windows XP Under the Hood: Hardcore Windows Scripting and Command Line Power

Copyright Copyright © 2003 by Que All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein. Library of Congress Catalog Card Number: 2001099513 Printed in the United States of America First Printing: September 2002 05 04 03 02 4 3 2 1 Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Que cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark. Warning and Disclaimer Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an "as is" basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book. Credits Associate Publisher Greg Wiegand Executive Editor Rick Kughen Acquisitions Editor Rick Kughen i Development Editor Todd Brakke Managing Editor Thomas F. Hayes Project Editor Sheila Schroeder Production Editor Maribeth Echard Copy Editor Bart Reed Indexer Ken Johnson Proofreader Plan-it Publishing Technical Editor Brian Fulk Team Coordinator Sharry Lee Gregory Multimedia Developer Michael Hunter Interior Designer Anne Jones Cover Designer Alan Clements ii Dedication To the teachers and staff of San Rafael High School, who gave me an education for which I am still grateful every day, 25 years later. —Brian iii About the Author Brian Knittel has been a software developer for more than 20 years. After doing graduate work in Electrical Engineering applied to nuclear medicine and magnetic resonance imaging technologies, he began a career as an independent consultant. An eclectic mix of clients has led to long-term projects in medical documentation, workflow management, real-time industrial system control, and most importantly, over 15 years of real-world experience with MS-DOS, Windows, and computer networking in the business world. Brian has coauthored Special Edition Using Microsoft Windows 2000 Professional, Special Edition Using Microsoft Windows XP Professional, and Special Edition Using Microsoft Windows XP Home Edition and has contributed to several other Windows books. Brian lives in Albany, California, halfway between the tidal wave zone and the earthquake fault. He spends his free time restoring antique computers (for example, see www.ibm1130.org) and trying to perfect his wood-fired pizza recipes. iv Acknowledgments I had a conversation with Que Executive Editor Rick Kughen a couple of years ago about the nifty but unglamorous tools and programs that are provided with Windows, the tools we somehow don't have room to write about in those thick Special Edition Using tomes. Perhaps I caught him at a weak and confused moment, but he suggested that I ought to write a book about them, and that Que ought to publish it. I bring this up because this was and is quite an honor. It's not every day that a publisher says, in essence, "If you're excited about this, we are too." So, to start with, I thank Rick Kughen for his confidence in me and in this project, and for his unflagging support, patience, encouragement, guidance, and more patience. All that and the guy is kind, funny, and one heck of a fisherman to boot. It's an honor to work with a highly respected publisher like Que. Thanks to Associate Publisher Greg Wiegand for his faith in me and in the rest of his outstanding team during this arduous project. This book would not have made any sense at all, or at least, it would not make whatever sense it does make without Todd Brakke's hand in developing and editing it. I am grateful for his organizational guidance and enthusiasm for the material. Also, many, many thanks to Bart Reed for not only his amazing attention to detail in copy editing, but for very helpful technical questions and answers. Don't let those job descriptions fool you—at Que at least, titles such as "development editor" and "copy editor" don't begin to describe the breadth of the contributions that each team member makes to each book. I'd also like to acknowledge the support of our technical editor Brian Fulk, who meticulously tried every sample program and example, and who went over every syntax statement with a fine-tooth comb. Then, there is an entire army of people who labor largely unseen and unthanked—the people who do the real work. I'd like to thank the editorial, indexing, layout, art, proofing, and other production staff at Que. And finally, thanks to Sheila Schroeder and Tonya Simpson for managing the whole project through its erratic course. I would not be writing at all if it were not for Bob Cowart who brought me into this arena to begin with. Thank you, Bob, for your confidence, partnership, and your example. I also thank Chris Van Buren for his hand in making this project come about and for taking care of the business end of all this. Then, there are the people who have made it possible for me to get through these months of writing: Frank and Pete who made me leave the office at least a few times to go snowboarding, the crew at Peet's Coffee & Tea who kept me well-decaffeinated every afternoon, my business partner Eric who has let me turn our office into a paper- and book-strewn horror house for the last six months, Mike Holloway who helped collate, research, and test the object and command-line references, and Bryce Carter who has provided guidance and encouragement of the deepest sort. Finally, love and gratitude to Norm, my anesthesiologist, whom I promised after the last round of book writing that life would soon get back to normal. Well, I may have missed by six or eight months, but it's going to happen. v Tell Us What You Think As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way. As an associate publisher for Que, I welcome your comments. You can e-mail or write me directly to let me know what you did or didn't like about this book—as well as what we can do to make our books better. Please note that I cannot help you with technical problems related to the topic of this book. We do have a User Services group, however, where I will forward specific technical questions related to the book. When you write, please be sure to include this book's title and author as well as your name, e-mail address, and phone number. I will carefully review your comments and share them with the author and editors who worked on the book. E-mail: [email protected] Mail: Greg Wiegand Que 201 West 103rd Street Indianapolis, IN 46290 USA For more information about this book or another Que title, visit our Web site at www.quepublishing.com. Type the ISBN (excluding hyphens) or the title of a book in the Search field to find the page you're looking for. vi Contents Copyright About the Author Acknowledgments Tell Us What You Think Introduction Why Learn About This Stuff? How This Book Is Organized Conventions Used in This Book Part I: Scripting Chapter 1. Introduction to Windows Script Host What Is a Windows Script? Scripting Languages A Simple Script Script Files Running Scripts Security Concerns Debugging Scripts Where to Get More Information Chapter 2. VBScript Tutorial Introduction to VBScript Flow Control VBScript Functions Interacting with the User Advanced VBScript Topics Where to Go from Here Chapter 3. Scripting and Objects Introduction to Objects Using Objects with VBScript Using Objects with JScript Using Objects with ActivePerl Using Objects with ActivePython Using Objects with Object REXX Using the WScript Object Locating and Using Unusual Objects Chapter 4. File and Registry Access Getting Real Work Done Manipulating Files and Folders Reading and Writing Files Reading and Writing XML and HTML Manipulating Programs and Shortcuts Working with the Environment Working with the Registry vii Chapter 5. Network and Printer Objects Managing Network and Printer Connections Displaying Network User Information Managing Drive Mappings Managing Network Printer Connections Printing from Scripts Chapter 6. Messaging Objects Sending E-mail from Scripts with CDO The CDO Object Model Sending a Message with CDO Chapter 7. Windows Management Instrumentation (WMI) Introduction to Windows Management Instrumentation Enabling WMI on Your Network's Computers Making WMI Connections WMI Collections and Queries WMI Applications For More Information Chapter 8. Active Directory Scripting Interface (ADSI) Managing the User Directory ADSI Concepts ADSI Objects for the WinNT: Provider IIS and Exchange Managing Active Directory Active Directory Objects Developing ADSI Scripts For More Information Chapter 9. Creating Your Own Scriptable Objects Why Create Your Own Objects? Programming Language Options Creating Objects with WSC Files WSC File Format Reference Creating a WSC Component Creating a Practical Object Chapter 10. Deploying Scripts for Computer and Network Management Using Scripts in the Real World Using WSF Files Deploying Scripts on a Network Creating Simple Installation Programs with IExpress Writing Scripts to Manage Other Computers Scripting Security Issues Setting Up Logon Scripts Scheduling Scripts to Run Automatically viii Part II: The Command-Line Environment Chapter 11. The CMD Command-Line Environment The Command Prompt Command-Line Processing Configuring the CMD Program Built-In Commands Running CMD Getting More Information Chapter 12. Batch Files for Fun and Profit Why Batch Files? Creating and Using Batch Files Batch File Programming Displaying Information in Batch Files Argument Substitution Argument Editing Conditional Processing with If Processing Multiple Arguments Working with Environment Variables Processing Multiple Items with the For Command Using Batch File Subroutines Prompting for Input Useful Batch File Techniques Chapter 13. The MS-DOS Environment Under Windows XP MS-DOS Programs on Windows XP Configuring the MS-DOS Environment MS-DOS and Networking Printing from MS-DOS Configuring Serial Communications with MS-DOS Using Special-Purpose Devices for MS-DOS Managing MS-DOS Programs Chapter 14. Command-Line Programs Windows Command-Line Programs The Essential Command Line GUI Shortcuts General-Purpose Shell Programs File-Management Tools Management Power Tools Networking Utilities Part III: Appendixes Appendix A. VBScript Reference VBScript 5.6 Language Features Syntax General Structure of a VBScript Program Data Types and Variables ix

Description:
Get ready to roll up those shirtsleeves, pop the hood, and get a little Windows grime under those fingernails! This is a book about tools, nuts and bolts. Through lucid tutorials and examples, Windows XP Under the Hood shows how to use scripting and batch tools to automate repetitive tasks. You'll m
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.