Describes a named argument for the script.
<named name = namedname helpstring = helpstring type = "string|boolean|simple" required = boolean />
simple.The <named> 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 as well as an argument named server in the WSHNamed arguments collection.
If the type is string, the argument is a string. The argument is passed to the script as /named:stringvalue.
If the type is Boolean, the argument is Boolean. The argument is passed to the script as /named+ to turn it on, or /named- to turn it off.
If the type is simple, the argument takes no additional value and is passed as just the name, /named.
The following script demonstrates the use of the <named> Element:
<job>
<runtime>
<named
name="server"
helpstring="Server to access"
type="string"
required="true"
/>
<named
name="user"
helpstring="User account to use on server. Default is current account."
type="string"
required="false"
/>
<named
name="enable"
helpstring="If true (+), enables the action. A minus(-) disables."
type="boolean"
required="true"
/>
<named
name="verbose"
helpstring="If specified, output will be verbose."
type="boolean"
required="false"
/>
</runtime>
<script language="JScript">
WScript.Arguments.ShowUsage();
</script>
</job>
This will produce the following output when usage is shown:
Usage: example.wsf /server:value [/user:value] /enable[+|-] [/verbose]
Options:
server : Server to access
user : User account to use on server. Default is current account.
enable : If true (+), enables the action. A minus(-) disables.
verbose : If specified, output will be verbose.
ShowUsage Method | <runtime> Element | <unnamed> Element | <description> Element | <example> Element