|
|
| Purpose: | Display a Windows Vista Task Dialog |
| Format: | TASKDIALOG [/I /S /W] buttontype "title" "instruction" [text] |
| buttontype | One or more of OK, CANCEL, YES, NO, RETRY, CANCEL, and/or CLOSE |
| title | Text for the task dialog title |
| instruction | Text for the main instruction |
| text | Optional additional text that appears below the main instruction, in a smaller font |
See also: INKEY, INPUT, MSGBOX and QUERYBOX.
Usage:
TASKDIALOG requires Windows Vista or later.
The button the user chooses is indicated using the internal variable %_?. Be sure to save the return value in another variable or test it immediately; because the value of %_? changes with every internal command. The following list shows the value returned for each button:
response |
|
Yes or OK |
10 |
No |
11 |
Cancel or Close |
12 |
Retry |
13 |
If there is an error in the TASKDIALOG command itself, %_? will be set to 2.
For example, to display a Yes / No message box and take action depending on the result, you could use commands like this:
taskdialog yes no "Copy" "Copy all files to A:?"
if %_? == 10 copy * a:
Since TASKDIALOG doesn't write to standard output, it disables redirection and piping to allow you to enter the redirection characters (<, >, and |) in your prompt text.
TASKDIALOG creates a popup dialog box. If you prefer to retrieve input from the command line, see the INKEY and INPUT commands.
Options: