A few weeks ago, I received an email from Randy Culbertson, who noted that he has the desire and time to learn scripting but didn't know where to start. That prompted me to contact several scripting experts so that I could compile a list of resources that Randy and others could use to learn scripting in the Windows environment.
To begin, it helps to know the basic concepts behind scripting. The article "An Introduction to Scripting Technologies and Object Models" (InstantDoc ID 8599) provides an easy-to-understand overview of scripting.
Before I go any further, let me mention two important notes:
One point that the article "An Introduction to Scripting Technologies and Object Models" brings up is that there are different scripting languages. Because many scripting languages exist, I decided to narrow the list. In this column, I'll cover the languages of Windows shell scripting and VBScript. For those of you who aren't new to scripting but maybe new to the Windows PowerShell (formerly code-named Monad), I'm including some resources for learning this new command-line shell's scripting language, which is called Powerscript. Next month, I'll discuss the resources for learning JScript, Perl, and T-SQL.
Which languages you should learn depends on the systems you work with. If you work with Windows, I suggest you learn shell scripting and VBScript. If you work with Microsoft SQL Server, you should probably learn shell scripting and T-SQL. Notice that I specified two languages. The more you learn, the better.
The scripting language that the Windows command processor (cmd.exe) uses is often referred to as Windows shell scripting. The 10-part series "Shell Scripting 101" is an excellent tutorial for people who want to learn to write .bat and .cmd scripts. (If you're wondering about the difference between .bat and .cmd scripts, read Lesson 2.) This series walks you the basics and even includes practical exercises you can try on your own. Here are the links to this series:
After you go through that series, you can check out the following articles:
One book that several scripting experts recommended is Tim Hill's book Windows NT Shell Scripting (Macmillan Technical Publishing, 1998).
VBScript is a scripting language associated with Windows Script Host. WSH is an environment for executing scripts. I like to think of WSH as a house. A house contains people and objects (e.g., furniture, appliances). In the WSH house, the scripting languages are the people. Two people permanently reside in that house: VBScript and JScript. And just like any house, there can be visitors. The WSH house visitors include Perl and Python. Whether the people reside in the house or are visitors, they can use the objects in that house. In the WSH house, the people can use objects such as the FileSystemObject object or the WScript object.
Good resources to learn about WSH include
Like the "Shell Scripting 101" series, the "Understanding VBScript" series is a tutorial that you can use to learn VBScript. The following articles cover the basics:
Although Windows PowerShell is still a release candidate, you can start learning about this new command-line shell and its scripting language. There's already been at least one book published: Andy Oakley's Monad Jumpstart (O'Reilly, 2005). Another book Windows PowerShell in Action is tentatively scheduled for publication in November by Manning Publications. Bruce Payette, a member of the Windows PowerShell team, is writing this book. You can read an unedited chapter at http://www.manning.com/payette.
Besides these books, there are some other types of resources available. Microsoft's Channel9 has some good basic information about PowerShell. The Windows Power Shell Wiki (http://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWiki) includes download information and a link to an FAQ Web page. The Microsoft TechNet Script Center offers the "Scripting with Windows PowerShell" Web site (http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx), which includes links to articles, Web casts, and scripts.
Other useful resources are newsgroups and blogs. You can find the microsoft.public.windows.powershell newsgroup on news.microsoft.com. If you don't use a standard newsreader, you can use the Web interface at http://support.microsoft.com/newsgroups/newsReader.aspx?dg=microsoft.public.windows.powershell. PowerShell blogs include the Windows PowerShell blog at http://blogs.msdn.com/powershell and the PowerShelled blog at http://mow001.blogspot.com.
This list of shell scripting, VBScript, and Powerscript resources isn't meant to be all-inclusive. It just contains resources that are known to be helpful. If you have come across any other resources that are helpful, please let me know and I'll add them to the list.