Hide Comments
Purpose:Display a Windows Task Dialog


Format:TASKDIALOG [/A"Details" /AC"text" /AE"text" /B"text" /C /E /F[EISW]"text" /H /I /L /N /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)/N (links)
/B(utton text)/P(osition)
/C(heckbox)/R(adio buttons)
/E (shield)/S(top icon)
/H(yperlinks)/W(arning icon)
/I(nformation icon)/X (closable)







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:




Yes or OK




Cancel or Close





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




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


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


/EDisplay the Windows security shield icon.


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


Esecurity shield


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


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


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