My plan is to post a series of hopefully useful and informative vbScript Functions and Subs. I started writing up my first code snippet and found that I was taking too many side trips to explain things about the vbScript syntax and language so I decided to postpone the first snippet until I had completed a vbScript intro.
There has been a lot of interest in scripting languages, most notably Perl and Python. While decidedly less versatile and powerful than Python, vbScript (which is way down on the list) has several good points to recommend it.
- It has a simple syntax
- It doesn't require a complex development environment
- It comes with every version of Windows
- Carefully written code can be easily ported to vb.Net
- It's great at tying software together/automating
The simple syntax still requires some effort to learn and some documentation. Even though Microsoft includes vbScript (cscript/wscript) with Windows, for some reason they have removed all traces of the associated help file, script56.chm. I've attached a zipped copy of that file with this post. Ignore the parts that relate to jscript.
Point number 2 notwithstanding, I find that having Visual Studio installed makes debugging much simpler as you can use the VS debugger to watch/single step through code just like you would a vb.Net or C# application.
For editing source code, while Notepad would do the job, there are much better (and free) editors available. While not free, I use TextPad and …