Describes a named argument for the script.
|
---|
<named
name = namedname
helpstring = helpstring
type = "string|boolean|simple"
required = boolean /> |
Arguments
- name
String that represents the name of the argument you are describing. Defines the argument at the command line and in the script.
- helpstring
String that represents the help description for the argument. The WSH runtime provides the help description using the ShowUsage method or the /? argument.
- type
Optional. Describes the type of argument, which defines how the argument will be parsed from the command line. The default value is simple
.
- required
Optional. A Boolean value that indicates whether an argument is required or not. Affects the display of the usage only.
Remarks
Example
The following script demonstrates the use of the <named> Element:
| Copy Code |
---|
<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:
| Copy Code |
---|
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. |
See Also