Windows Script Host  

<unnamed> Element

Describes an unnamed argument for the script.

<unnamed
   name       unnamedname
   helpstring helpstring
   many       boolean
   required   boolean or integer
/>

Arguments

name
The string that is used in the usage to represent this argument. This value is not used elsewhere.
helpstring
String that represents the help description for the argument. The WSH runtime provides the help description using the ShowUsage method or the /? argument.
many
Optional. Boolean value. If true, then this argument may be repeated more times than specified by the required attribute. Otherwise, the required attribute represents the exact number of the argument that is required. See the example below for more details.
required
Optional. An integer value indicating how many times this argument should appear in the command line.

Remarks

The <unnamed> element is contained by (enclosed within) a set of runtime tags.

An argument with the name server would provide a /server argument at the command line and an argument named server in the WSHNamed arguments collection.

Note   The name attribute of the unnamed element is just for display purposes.

When setting the "required" attribute, a Boolean value will be converted to an integer; "true" becomes 1 and "false" becomes 0.

Example

Here are a couple of examples of how the various attributes affect the usage with unnamed elements. First, a simple case:

<runtime>
<unnamed
  name="filename"
  helpstring="The file to process"
  many="false"
  required="true"
</>
</runtime>

This would produce the following:

Usage: example.wsf filename

Options:

filename : The file to process

Change it to:

<runtime>
<unnamed
  name="filename"
  helpstring="The files to process"
  many="false"
  required="3"
</ >
</runtime>

and the output changes to:

Usage: example.wsf filename1 filename2 filename3

Options:

filename : The files to process

The many switch will display ellipses to indicate you can enter more files than indicated. If the example changes to:

<runtime>
<unnamed
  name="filename"
  helpstring="The file(s) to process"
  many="true"
  required="1"
</>
</runtime>

then the output changes to:

Usage: example.wsf filename1 [filename2...]

Options:

filename: The file to process.

See also

ShowUsage Method | <runtime> Element | <named> Element | <description> Element | <example> Element