VBScript Library

VBScript is a good tool for quick server tasks without needing to install some cumbersome runtime environment. At a minimum I want my scripts to:

  • log what they are doing (or at least have the option to)
  • e-mail administrators if fatal errors occur
  • be as user configurable as possible

The VBScript Library was created to provide these minimal requirements. This isn't a library I'm actively building, I'll throw more classes in as I need and build them.

Download

Current version: 1.0

VBScript-Library-v1.0.zip (14KB)

Packages and Classes

Package Class Description
data Provides classes for manipulating and working with data.
data ContentValues Wrapper around Scripting.Dictionary that allows key/value pairs to be spliced into an output string using %SPECIAL_FIELDS%.
io Provides classes for reading, writing and manipulating files.
io IniFile Allows manipulation of .ini files both in-memory and to disk.
io LogFile Provides log file functionality to scripts including configurable verbosity and log file rotation.
net Classes for interacting with the network and network services.
net CdoMessageHelper Wrapper around CDO to pre-configure CDO.Message objects with connection and configuration details.

Using the Library

The library is just a zip file of .vbs files, one file per class structured into "packages", these are just directories to organise the classes.

To use the library:

  • Download and extract the zip file into your projects root directory
  • Create or amend your WSF to include any class files you need as well as your own VBS files

Sample WSF file:

<job id="MyProject">
  <script language="VBScript" src="lib\cjs\io\IniFile.vbs" />
  <script language="VBScript" src="lib\cjs\io\LogFile.vbs" />
  <script language="VBScript" src="lib\cjs\net\CdoMessageHelper.vbs" />
  <script language="VBScript" src="src\MyCode.vbs" />
</job>