|
-
Dec 27th, 2005, 02:51 PM
#1
Thread Starter
Addicted Member
Porting VBScript to Server 2003
I have the following test script: Test.vbs.
VB Code:
Dim oWSArgs
Set oWSArgs = WScript.Arguments
WScript.StdOut.WriteLine StringMatch(oWSArgs(0), oWSArgs(1), True)
Function StringMatch(sString, sPattern, bIgnoreCase)
Dim oRegEx
Set oRegEx = New RegExp
oRegEx.IgnoreCase = bIgnoreCase
oRegEx.Pattern = sPattern
StringMatch = oRegEx.Test(sString)
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:
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
Travis, Kung Foo Journeyman
Web Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.5 Guide and Reference
Perl: Documentation, Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
OSS: Mozilla, MySQL (Manual)
-
Dec 27th, 2005, 03:06 PM
#2
Re: Porting VBScript to Server 2003
WSCRIPT has the /NOLOGO flag, which goes after the filename, and before the arguments. To find other flags, use WSCRIPT /?
-
Dec 27th, 2005, 03:19 PM
#3
Thread Starter
Addicted Member
Re: Porting VBScript to Server 2003
Thanks, David. //Nologo works.
Anyone have any ideas on the root problem?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|