I have the following test script: Test.vbs.

VB Code:
  1. Dim oWSArgs
  2. Set oWSArgs = WScript.Arguments
  3.  
  4. WScript.StdOut.WriteLine StringMatch(oWSArgs(0), oWSArgs(1), True)
  5.  
  6. Function StringMatch(sString, sPattern, bIgnoreCase)
  7.  
  8.     Dim oRegEx
  9.     Set oRegEx = New RegExp
  10.    
  11.     oRegEx.IgnoreCase = bIgnoreCase
  12.     oRegEx.Pattern = sPattern
  13.     StringMatch = oRegEx.Test(sString)
  14.  
  15. End Function

It works on this Windows XP Professional machine. But I am getting a subscript out of range error on the Windows Server 2003 machine to which I am trying to port it on the output line:

VB Code:
  1. WScript.StdOut.WriteLine StringMatch(oWSArgs(0), oWSArgs(1), True)

I'm sure the answer is obvious, but I'm not finding it.

Also, is it possible to avoid the title and copyright lines in the output?

Code:
C:\foo>Test.vbs "foo bar blah", "ar"
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

True