Purpose:Display a Windows Task Dialog

 

Format:TASKDIALOG [/A"Details" /B"text" /C /F[ISW]"text" /H /I /L /P=x,y /R"text" /S /V"text" /W /X] buttontype "title" "instruction" [text]

 

buttontypeOne or more of OK, YES, NO, RETRY, CANCEL, and/or CLOSE
titleText for the task dialog title
instructionText for the main instruction
textOptional additional text that appears below the main instruction, in a smaller font

 

/A(details)/P(osition)
/B(utton text)/R(adio buttons)
/C(heckbox)/S(top icon)
/F(ooter)/V(erification)
/H(yperlinks)/W(arning icon)
/I(nformation icon)/X (closable)

/L(inks)

 

See also: INKEY, INPUT, MSGBOX and QUERYBOX.

 

Usage:

 

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 allow you to enter the redirection characters (< and >) in your prompt text. If you want to use pipe characters or command separators, you will need to escape or quote them.

 

TASKDIALOG creates a popup dialog box. If you prefer to retrieve input from the command line, see the INKEY and INPUT commands.

 

TASKDIALOG can set three internal variables:

 

_taskdialog_button - the button pressed to exit TASKDIALOG

_taskdialog_radio - the selected radio button (if any) in TASKDIALOG

_taskdialog_verify - returns 1 if the verify button was checked

 

Options:

 

/A"details"TASKDIALOG will show a button that you can click to expand the dialog and view the text specified in "Details".

 

/B"text"Text to use for custom buttons. If you specify one or more /B arguments, TASKDIALOG will not display any of the default buttons. TASKDIALOG will return the button ID of the button pushed in the command variable %_taskdialog_button. TASKDIALOG will number the custom button ID's beginning at 1000.

 

/CCheck the verification checkbox at TASKDIALOG startup. (The checkbox defaults to unchecked.)

 

/F"text"Display footer text with an optional icon:
Iinformation
Serror
Wwarning

 

/Henable hyperlinks embedded in the additional info (/A) text, the footer (/F) text, and the main instruction text. Hyperlinks are created with an <a> HTML tab. For example:

 

/A"This is a hyperlink: <a href=^"https://jpsoft.com/^">Full details about Take Command 20.0</a>"

/IDisplay an icon consisting of a lower case "i" in a circle in the message box.

 

/LConvert the buttons defined by /B into command links. A command link is a bigger button that has an icon and optionally a second smaller line of text. (To display a second line, append a ^n to the /B argument, followed by the text for the second line.)

 

/PDisplay the task dialog at the specified screen coordinates. If /P is not specified, TCC will center the dialog.

 

/R"text"Display radio buttons. The selected button will be returned in the command variable %_taskdialog_radio. TASKDIALOG will number the custom radio button ID's beginning at 2000.

 

/SDisplay a stop sign icon in the message box.

 

/V"text"Display a verification checkbox. If the box is checked, the command variable %_taskdialog_verify will be set when TASKDIALOG exits.

 

/WDisplay an exclamation point icon in the message box.

 

/XThe task dialog can be closed using Alt-F4, Escape, and the title bar's close button even if no cancel button is specified.