' Listing 1: The checkArguments Subroutine Private Sub checkArguments() Dim strCmd, objItem, i, j, customServerList Dim ExcludeServer, objServer, arrExServers(), strInputFile ' ******* BEGIN CALLOUT A ******* ' Get argument(s) when run under CScript. With WScript.Arguments If .Count > 0 Then For i = 0 To WScript.Arguments.Count - 1 ReDim Preserve arrArguments(i) arrArguments(i) = WScript.Arguments(i) If i = 0 Then If Mid(arrArguments(i),1,1) <> "/" Then ShowUsage() End If End If Next ' ******* END CALLOUT A ******* i = 0 For Each objItem In arrArguments i = i + 1 Select Case i Case 1 strCmd = LCase(objItem) Select Case strCmd Case "/","/?","/h","help","-h","-help" ShowUsage() Case "/e" ExcludeServer = True Case "/f" customServerList = True Case Else ShowUsage() End Select Case 2 strCmd = Trim(objItem) ' ******* BEGIN CALLOUT B ******* If ExcludeServer = True Then If InStr(strCmd,",") > 0 Then For Each objServer In Split(strCmd,",") ReDim Preserve arrExServers(j) arrExServers(j) = UCase(objServer) j = j + 1 Next Else ReDim Preserve arrExServers(j) arrExServers(j) = UCase(strCmd) End If ' ******* END CALLOUT B ******* ' ******* BEGIN CALLOUT C ******* ElseIf customServerList = True Then strInputFile = strCmd ' ******* END CALLOUT C ******* End If Case Else ShowUsage() End Select Next End If ' Make sure that the user supplies the necessary arguments. If ExcludeServer = True Or customServerList = True Then If i <> 2 Then ShowUsage() End If End With ' ******* BEGIN CALLOUT D ******* RuntheScript strInputFile, arrExServers ' ******* END CALLOUT D ******* End Sub