Purpose:Display a Windows Task Dialog

 

Format:TASKDIALOG [/A[F][X]"Details" /AC"text" /AE"text" /B"text" /C /DB:n /DR:n /E /F[EISW]"text" /H /I /L /N /P=x,y /R"text" /S /T:n /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)/L(inks)
/B(utton text)/N (links)
/C(heckbox)/P(osition)
/DB (default button)/R(adio buttons)
/DR (default radio button)/S(top icon)
/E (shield)/T(imeout)
/F(ooter)/V(erification)
/H(yperlinks)/W(arning icon)
/I(nformation icon)/X (closable)

 

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.

 

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.

 

You can copy the text in a TASKDIALOG window to the clipboard by entering Ctrl-C when the TASKDIALOG window has the keyboard focus.

 

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

 

Example:

 

Display a Yes / No message box and take action depending on the result:

 

taskdialog yes no "Copy" "Copy all files to A:?"

if %_? == 10 copy * a:

 

Options:

 

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

 

/AC"text"The button text for collapsing the expandable information.

 

/AE"text"The button text for expanding the expandable information.

 

/AF"details"Like /A, but TASKDIALOG will show the details at the bottom of the dialog's footer area instead of immediately after the contents.

 

/AX"details"Like /A, but TASKDIALOG will show the expanded details by default.

 

/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. The maximum number of custom buttons is 10.

 

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

 

/DB:xxDefault button. This can either be a number (1000-n for custom buttons, or a defined button type:

 

OK

Yes

No

Cancel

Retry

Close

 

/DR:nThe default radio button (2000 - n, only valid when used with /R).

 

/EDisplay the Windows security shield icon.

 

/F"text"Display footer text with an optional icon:

 

Esecurity shield
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 28</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.)

 

/NCustom buttons (see /B and /R) are to be displayed as command links instead of push or radio buttons.

 

/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. The maximum number of radio buttons is 10.

 

/SDisplay a stop sign icon in the message box.

 

/T:nTimeout after n seconds. If TASKDIALOG times out, it will return the Cancel / Close button value (12).

 

/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.