Editor's note: This is the 12th column in a continuing series on scripting that appears monthly on SearchWinSystems.com....
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
Feel free to send any scripting questions to the author, Christa Anderson, at email@example.com.
Since I'm so often asked where to find good scripting resources, this month's column will discuss some online resources that I think you'll find helpful. This is by no means a complete list; if you have another resource to share, send it along and we can build a community collection. (Just for the record, I don't have any affiliation with any of the sites below.)
The big daddy of online scripting resources is Microsoft's site. The good news is that it is the source of the entire official documentation, Windows 2000 Scripting Guide, not to mention many articles and columns written for a broad range of skill levels. The bad news is that the site can be hard to use for complete novices, and it is not the best place to go to find a quick answer about how a function or object works. While my August 2005 column on the topic of object structure will help you in that regard, right now I'd like to discuss how to use Microsoft's site.
The site provides the absolute basics, but anyone reading this column is probably beyond that point (since I covered it in the first few columns in my series). Still, you might want to use this page as a refresher.
From this page, you can link to Sesame Script by the Scripting Guys. It, too, is pretty basic and can serve as a refresher course. The catch is that the Sesame Script columns don't give you any working scripts; they're more about features than tasks.
Although the beginner page suggests you review the Windows 2000 Scripting Guide, I don't recommend actually reading the guide to learn how to script. It's a complete reference, and a very good one, but novices may find the examples difficult to follow since they're rarely a complete script in themselves. And, since they exist in a vacuum, they're hard to experiment with. On the other hand, if you need to know exactly which methods and properties are available to an object, or which objects are available and how they're collected, then this is the place to look.
Tales from the Script is entertaining, but getting to the point takes a long time. If you have the time, reading these articles is a good way to find out what you can accomplish with scripting, but they're too wordy to serve as any kind of instant reference.
More succinct is the entertaining site called The Hey, Scripting Guy Archive. Like Sesame Script, it doesn't offer complete scripts for download, but its snippets are very helpful.
Want more examples and a bit more meat? Check out Dr. Scripto's Script Shop. The columns here are not for novices, but if you've been following my columns all this time, you'll be able to understand what you find here.
Want to search the Microsoft site for specific scripting information but you aren't sure where to look? You may find using an external search engine easier than navigating the Microsoft site. Google, of course, is excellent. To confine a search to Microsoft's site, end your search with site:microsoft.com. For example, to search for information about folders in the File System Object, you'd search fso folders site:microsoft.com. Microsoft's scripting resources are very good and well-written (as you might expect from the company that developed VBScript and can pay knowledgeable people to write columns.) But they're not always the best for quick references.
If you're pretty sure about the name of the object, statement, function or anything else you want to use, and just want to see some usage examples, other options may suit you better. But be very watchful for accuracy. Third-party sites, especially those that support user contributions, are not necessarily technically reviewed. If something doesn't work, be prepared to cross-reference. Having said that, here are three of my favorites:
- Dev Guru is an excellent quick resource that complements Microsoft's online book very well. Not quite sure how that method really works? Plug it into DevGuru to get a second opinion. Another plus: The site doesn't overwhelm you with advertising.
- Sloppycode.net offers a quick and dirty summing up of many of the objects you need, as well as some samples. Some of the entries you'll find here stem from reader questions, and that can be a bonus if you find a question that matches yours.
- Although it's actually an ASP site, W3 Schools has some good examples of scripts, plus an added bonus: It shows the output, which makes it much simpler to see, quickly, how sample code works and what it does.
Although I think that the combination here of explanations and live script is the best way to learn how to script, there are also some good resources for learning background and for getting samples. For those who write to me wanting good online resources for learning to script, rest assured that you are visiting one of them. To supplement, try Microsoft's references or one of these other sites for quick lookups and examples.
Read all of Christa's scripting columns:
April 2005: Beginner's guide to scripting
May 2005: It's time to increase your scripting expertise
June 2005: Connect users to network resources
July 2005: More on connecting to network resources
August 2005: Find objects with Windows Scripting Host
September 2005: Windows Script Host arguments
October 2005: Scripting School: Turning the environment with WshShell
November 2005: Scripting School: Connect scripts to remote computers
December 2005: Scripting School: Writing output to a text file
January 2006: Scripting School: Taking inventory of drives
February 2006: Scripting School: Enhancing scripts that require user input
|ABOUT THE AUTHOR:|
| Christa Anderson
When Christa Anderson began working with Windows Server operating systems in 1992, she became increasingly interested in finding more efficient and flexible ways of performing routine tasks. Christa has written extensively about administrative scripting and taught technical sessions on the subject at conferences such as Comdex and CeBIT, helping people who had never done any scripting to write their own scripts in half a day. In addition to her interest in scripting Windows management, Christa is an authority on server-based computing and the program manager for Terminal Services licensing in Longhorn. If you have a scripting question for Christa, please e-mail her at editor@SearchWincomputing.com.