Using Multiple Arguments

In pingMultipleComputers.vbs, you use only one argument, which you assigned to the variable strMachines by using this command:

strMachines = WScript.Arguments.Item(0)

When you look at the command, you see that it’s made up of several parts:

Variable

=

WScript.Arguments.Item

Item #

strMachines

=

WScript.Arguments.Item

(0)

If you need to use multiple arguments or multiple items (whichever term you prefer), you simply add another line and increment the item number contained within the parentheses.

Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.