Please enable JavaScript to view this site.

Take Command / TCC Help v. 27

Navigation: » No topics above this level «

What's New in Version 27

Scroll Prev Top Next More

Take Command 27.0:

 

The Take Command, TCC, CMDebug, and TCC-RT installers are built with a new version of Advanced Installer.

 

Dropped 32-bit support for TCC-RT v27.

 

 

Take Command:

 

Many performance & size improvements.

 

The GUI framework library has been updated.

 

If the "auto attach consoles" option is enabled, Take Command will check to ensure the console is on the same virtual desktop before attaching it to a tab.

 

The tab label context menu (right click) has a new option "Notifications..." that displays the Notification dialog. This dialog allows you to send an activity and/or silence notification request to Take Command (see also the NOTIFY command in the TCC new commands below).

 

Activity notifications: When Take Command updates the tab window, it checks to see if the time since the last update is >= to timeout, and if so it will execute the specified command.

 

Silence notification: timeout is the number of seconds without any display output before Take Command will execute the specified command.

 

repeat - The number of times to notify on a matching activity / silence, or "forever".

 

timeout - The number of seconds before triggering a notification.

 

command - The command to execute on an activity / silence match

 

 

TCC:

 

Many performance & size improvements.

 

The IPWorks internet & compression libraries have been updated to IPWorks 2020.

 

Everything Search has been updated to 1.4.1.1001.

 

The embedded Lua interpreter has been updated to version 5.4.2.

 

Added support for Python 3.9.

 

Batch file nesting limits have been removed (now only subject to the memory available).

 

Variable name length limits have been removed.

 

FTP - TCC will try to preserve timestamps when transferring files. The MDTM command is used when downloading, and the MFTM command is used when uploading. The server must support these commands for this to work.

 

Array variable expansion now supports arithmetic expressions (for example, "echo %myarray[%i*3]").

 

The previous XML parser in TCC (msxml6) has been replaced with a more powerful parser that provides much more capability, including both reading & writing XML and JSON files.

 

 

IDE / Batch Debugger:

 

The GUI framework library has been updated.

 

The Scintilla edit control has been updated to version 4.5.5.

 

The debugger has a new "Call Stack" window that displays the current call stack (the filename, line #, command line, and the line(s) that called it (i.e., GOSUB or CALL). Double-clicking on a line in the Call Stack window will take you to that line in the tab window. (Note that the call stack is only expanded when you "Step Into" the next command.)

 

When debugging batch files that CALL or chain to another batch file (or GOSUB "filename: :label), or call a library function, if you "Step Into", the debugger will open a new tab window for the new file / library (if a tab window with that file doesn't already exist). The new tab window will be automatically closed when control returns to the calling batch file. If you stop debugging, all the windows will remain open to allow you to make edits.

 

The Environment window is rewritten after stepping through each command so it can catch updates. It now saves its row position and restores that after rewriting the contents (so it no longer always goes back to the beginning of the environment list).

 

 

TCEDIT:

 

The GUI framework library has been updated.

 

The Scintilla edit control has been updated to version 4.4.5.

 

If you specify a file that doesn't exist when starting TCEdit (and you didn't specify /C), TCEdit will display a messagebox asking if you want to create the file.

 

Yes - Creates a new empty file and opens it in the active tab window.

No - Opens an untitled empty tab window (you will need to name the file before saving).

Cancel - Exits TCEdit.

 

 

Help:

 

The help is built with a new version (8.2) of Help & Manual.

 

 

New TMCD.INI Directives:

 

PowerShellProfileID=string - The profile Id to look for when loading profiles. TCC will look for profiles that begin with the specified Id. For instance, the default value is "Microsoft.PowerShell" so the class will look for profiles named "Microsoft.PowerShell_profile.ps1".

 

TimeServerPort=n - The UDP port where the remote time server is listening (default 123). If TimeServerProtocol is set to tpTimeProtocol (1) the port will be set to 37.

 

TimeServerProtocol=n - The protocol used to connect to the time server. The default is 1 (tpSNTP). The Time protocol may be selected by setting this value to 0 (tpTimeProtocol).

 

 

New Internal Variables:

 

_BATCHPATH - Pathname of the current batch file (including the trailing \).

 

_IPDNSOTHER - A space-delimited list of other DNS servers configured for the host machine. (The primary server is returned by %_IPDNSSERVER.)

 

 

New Variable Functions:

 

@IPBROADCAST - The broadcast address of the specified network adapter.

 

@IPBROADCAST[adapter]

 

adapter - the index of the adapter

 

@IPDHCPENABLED - Returns 1 if the specified network adapter has DHCP enabled.

 

@IPDHCPENABLED[adapter]

 

adapter - the index of the adapter

 

@IPEXPIRES - The expiration date and time of the lease obtained by the specifed network adapter.

 

@IPEXPIRES[adapter]

 

adapter - the index of the adapter

 

@IPIPV6LL - The IPv6 link local address of the specified network adapter.

 

@IPIPV6LL[adapter]

 

adapter - the index of the adapter

 

@IPOBTAINED - The date and time of when the current lease was obtained by the network adapter.

 

@IPOBTAINED[adapter]

 

adapter - the index of the adapter

 

@IPOTHER - Returns a space-delimited list of alternate addresses for the specified host (if any). Most hosts have only one IP interface; this function is for querying multihomed hosts (hosts with more than one interface).

 

@IPOTHER[name, address]

 

name - the host name

address - the host address

 

@IPOTHERL - Returns a space-delimited list of any other IP addresses leased by the specified network adapter.

 

@IPOTHERL[adapter]

 

adapter - the index of the adapter

 

@IPSTATUS - Returns the current status of the specified network adapter.

 

@IPSTATUS[adapter]

 

adapter - the index of the adapter

 

Possible return values are:

 

Up

Down

Testing

Unknown

Dormant

NotPresent

LowerLayerDown

 

@IPWINSSERVER2 - Returns the secondary WINS server for the specified network adapter.

 

@IPWINSSERVER2[adapter]

 

adapter - the index of the adapter

 

@JSONCLOSE - closes a JSON file opened by @JSONOPEN. The syntax is:

 

@JSONCLOSE[]

 

@JSONENDARRAY - Writes the closing bracket of a JSON array. The syntax is:

 

@JSONENDARRAY[]

 

@JSONENDOBJECT - Writes the closing brace of a JSON object. The syntax is:

 

@JSONENDOBJECT[]

 

@JSONFLUSH - Flushes the JSON parser buffers. The syntax is:

 

@JSONFLUSH[]

 

@JSONHASXPATH - returns 1 if the XPath exists in the JSON file, 0 if it doesn't. The syntax is:

 

@JSONHASXPATH[["filename",]xpath]

 

The xpath always begins with /json.

 

If you do not specify a filename, @JSONHASXPATH will use the file previously opened by @JSONOPEN.

 

@JSONINPUT - Parse an input string as JSON data. (This is used in place of @JSONOPEN.) The syntax is:

 

@JSONINPUT[inputdata]

 

@JSONINSERTPROPERTY - Writes a value of a property. The file must have been opened with a previous @JSONOPEN. The syntax is:

 

@JSONINSERTPROPERTY[xpath,name,value,type,position]

 

Name specifies the name of the property.

 

Value specifies the new value.

Type specifies the type of the value. Possible values are:

0 (Object)

1 (Array)

2 (String)

3 (Number)

4 (Bool)

5 (Null)

6 (Raw)

 

The Position parameter specifies the position of Value relative to the element specified by XPath. Possible values are:

0 (Before the current element)

1 (After the current element)

2 (The first child of the current element)

3 (The last child of the current element)

 

@JSONINSERTVALUE - Inserts the specified value at the selected position. The file must have been opened with a previous @JSONOPEN. The syntax is:

 

@JSONINSERTVALUE[xpath,value,type,position]

 

Value specifies the new value.

Type specifies the type of the value. Possible values are:

0 (Object)

1 (Array)

2 (String)

3 (Number)

4 (Bool)

5 (Null)

6 (Raw)

 

The Position parameter specifies the position of Value relative to the element specified by XPath. Possible values are:

0 (Before the current element)

1 (After the current element)

2 (The first child of the current element)

3 (The last child of the current element)

 

@JSONNODES - Returns the number of nodes (children) for the specified path in a JSON file. The syntax is:

 

@JSONNODES[["filename",]path]

 

@JSONOPEN - open a JSON file for use by @JSONXPATH and/or @JSONNODES. The syntax is:

 

@JSONOPEN[filename]

 

@JSONOUTPUT - Output JSON to a string after processing. (This is used in place of @JSONSAVE.) The syntax is:

 

@JSONOUTPUT[]

 

@JSONPUTNAME - Writes the name of a property. The file must have been opened with a previous @JSONOPEN. The syntax is:

 

@JSONPUTNAME[name]

 

@JSONPUTPROPERTY - Writes the name of a property and its value to a JSON file. The syntax is:

 

@JSONPUTPROPERTY[name,value,type]

 

The name parameter specifies the name of the property.

The value parameter specifies the value of the property.

The type parameter specifies the type of the value. Possible values are:

0 (Object)

1 (Array)

2 (String)

3 (Number)

4 (Bool)

5 (Null)

6 (Raw)

 

@JSONPUTRAW - Writes a raw JSON fragment to a JSON file. The syntax is:

 

@JSONPUTRAW[text]

 

@JSONPUTVALUE - Writes a value of a property. The file must have been opened with a previous @JSONOPEN. The syntax is:

 

@JSONPUTVALUE[value,type]

 

Value specifies the new value.

ValueType specifies the type of the value. Possible values are:

0 (Object)

1 (Array)

2 (String)

3 (Number)

4 (Bool)

5 (Null)

6 (Raw)

 

@JSONREMOVE - Removes the element or value set in XPath. The syntax is:

 

@JSONREMOVE[xpath]

 

If xpath is not specified, @JSONREMOVE will use the current XPath.

 

@JSONRESET - Flushes the JSON parser buffers, and initializes the parser to its default state. The syntax is:

 

@JSONRESET[]

 

@JSONSAVE - Saves the modified JSON document to the specified output file. The file must have been opened with a previous @JSONOPEN. The syntax is:

 

@JSONSAVE[outputfile[,overwrite]]

 

If overwrite is 1, @JSONSAVE will overwrite an existing file. Otherwise, @JSONSAVE will display an error.

 

@JSONSETNAME - Sets a new name for the element specified by XPath. The file must have been opened with a previous @JSONOPEN. The syntax is:

 

@JSONSETNAME[xpath,] name]

 

If xpath is not specified, @JSONSETNAME will default to the current xpath.

 

@JSONSETVALUE - Sets a new value for the element specified by XPath. The file must have been opened with a previous @JSONOPEN. The syntax is:

 

@JSONSETVALUE[xpath,]value,type]

 

If xpath is not specified, @JSONSETVALUE will default to the current xpath.

 

value specifies the new value.

type specifies the type of the value. Possible values are:

0 (Object)

1 (Array)

2 (String)

3 (Number)

4 (Bool)

5 (Null)

6 (Raw)

 

@JSONSTARTARRAY - Writes the opening bracket of a JSON array. The syntax is:

 

@JSONSTARTARRAY[]

 

@JSONSTARTOBJECT - Writes the opening brace of a JSON object. The syntax is:

 

@JSONSTARTOBJECT[]

 

@JSONXPATH - JSON XPath query. The syntax is:

 

@JSONXPATH[["filename",]path]

 

The path is a series of one or more element accessors separated by '/'. The path can be absolute (starting with '/') or relative to the current XPath location. Note: When using XPath notation the root element is always referred to as "json". This means all paths will begin with "/json".

The following are possible values for an element accessor:

name

A particular element name.

[i]

The i-th subelement of the current element.

..

the parent of the current element.

@PUNYDECODE - Decode a Punycode string or file. The format is:

 

@PUNYDECODE[s,string]

@PUNYDECODE[inputfile,outputfile]

 

@PUNYENCODE - Encode a Punycode string or file. The format is:

 

@PUNYENCODE[s,string]

@PUNYENCODE[inputfile,outputfile]

 

@QPDECODE - Decode using the Quote-Printable MIME format (using only special characters). The format is:

 

@QPDECODE[s,string]

@QPDECODE[inputfile,outputfile]

 

@QPENCODE - Encode using the Quote-Printable MIME format (using only special characters). The format is:

 

@QPENCODE[s,string]

@QPENCODE[inputfile,outputfile]

 

@XMLENDELEMENT - Writes the closing tab of an XML element opened using @XMLSTARTELEMENT. If no elements are open, @XMLENDELEMENT returns an error. The syntax is:

 

@XMLENDELEMENT[]

 

@XMLFLUSH - Flushes the XML parser buffers, and checks its end state. The syntax is:

 

@XMLFLUSH[]

 

@XMLGETATTR - Returns the value of the specified attribute. The syntax is:

 

@XMLGETATTR[["filename",],attributename]

 

@XMLHASXPATH - returns 1 if the XPath exists in the XML file, 0 if it doesn't. The syntax is:

 

@XMLHASXPATH[["filename",]xpath]

 

@XMLINPUT - Parse an input string as XML data. (This is used in place of @JXMLOPEN.) The syntax is:

 

@XMLINPUT[inputdata]

 

@XMLOUTPUT - Output XML to a string after processing. (This is used in place of @XMLSAVE.) The syntax is:

 

@XMLOUTPUT[]

 

@XMLPUTATTR - Writes an XML attribute on the currently opened XML element. The syntax is:

 

@XMLPUTATTR[name,namespaceURI,value]

 

@XMLPUTCDATA - Writes an XML CDATA block. The file must have been opened with a previous @XMLOPEN. The syntax is:

 

@XMLPUTCDATA[text]

 

@XMLPUTCOMMENT - Writes an XML comment block. The file must have been opened with a previous @XMLOPEN. The syntax is:

 

@XMLPUTCOMMENT[text]

 

@XMLPUTELEMENT - Writes a simple XML element with no attributes and the specified value between the opening and closing tags. The syntax is:

 

@XMLPUTELEMENTname,namespaceURI, value]

 

If name is a local name without a prefix, TCC will automatically introduce a new xmlns="NamespaceURI" attribute if necessary.

If name is in the form prefix:local, then TCC will automatically introduce a new xmlns:prefix="NamespaceURI" as necessary.

When calling @XMLPutElement or @XMLStartElement, if a namespaceURI is not specified an empty namespace will be defined for the element. If a namespace should be associated with the element, a namespaceURI value must be provided. When creating the XML, TCC will determine if the namespace already exists to avoid duplicate definitions of the same namespace.

@XMLPUTSTRING - Writes text inside an XML element. The file must have been opened with a previous @XMLOPEN. The syntax is:

 

@XMLPUTSTRING[text]

 

@XMLREMOVECHILDREN - Removes the children of the element at the specified (or current) XPath. The element itself remains. The syntax is:

 

@XMLREMOVECHILDREN[[path]]

 

@XMLREMOVEELEMENT - Removes the element and its children at the specified (or current) XPath. The syntax is:

 

@XMLREMOVEELEMENT[[path]]

 

@XMLRESET - Flushes the XML parser buffers, and initializes the parser to its default state. The syntax is:

 

@XMLRESET[]

 

@XMLSAVE - Saves the modified XML document to a the specified output file. The file must have been opened with a previous @XMLOPEN. The syntax is:

 

@XMLSAVE[outputfile]

 

@XMLSTARTELEMENT - Writes the opening tag of a new XML element. If an XML element is already opened, then this element is written as a child. The syntax is:

 

@XMLSTARTELEMENTname,namespaceURI]

 

 

Updated Internal Variables:

 

_cpu is obsolete and has been removed.

 

_wow64 is obsolete and has been removed.

 

 

Updated Variable Functions:

 

@LUA - updated to Lua 5.4.2.

 

@PING - added two new options for the time to live and the ICMP service type.

 

@ping[host[,timeout[,size[,ttl[,type]]]]

 

ttl - Time to live - defaults to the TTL value of the underlying TCP/IP subsystem

 

type - ICMP service type (default 8)

 

@SELECT - if you set the sort option to -1, @SELECT will sort the list in reverse order.

 

@XMLXPATH - the path argument has additional options.The path is a series of one or more element accessors separated by '/'. The path can be absolute (starting with '/') or relative to the current XPath location.

The following are possible values for an element accessor:

'name'

A particular element name

name[i]

The i-th subelement of the current element with the given name

[i]

The i-th subelement of the current element

[last()]

The last subelement of the current element

[last()-i]

The subelement located at the last location minus i in the current element

name[@attrname="attrvalue"]

The subelement containing a particular value for a given attribute (supports single AND double quotes)

..

The parent of the current element

 

Updated Commands:

 

COPY

 

COPY /G now supports HTTP / HTTPS copies.

 

/GZ - When copying to an HTTP / HTTPS target, this option will compress the file into gzip format before uploading it.

 

ESET

 

/K"::regex" - defines a regular expression mask for the input.

 

If you are editing a typed environment variable (see SET /T), ESET will create a matching regular expression mask for the input.

 

EVERYTHING

 

Everything Search has been updated to version 1.4.1.1001.

 

HASH

 

HASH now supports ranges and selection by attributes.

 

/S - Return hashes for matching files in the current directory and subdirectories.

 

IFTP

 

IFTP will try to preserve timestamps when transferring files. The MDTM command is used when downloading, and the MFTM command is used when uploading. The FTP host server must support these commands for this to work.

 

LIBRARY

 

(Not new, but apparently never documented.) The command line following the library function name is passed to the function, and the arguments can be referenced with the same %1 - %n syntax as used by batch files and aliases.

 

LUA

 

The internal Lua support has been updated to Lua 5.4.2.

 

ON

 

There are new options to execute commands on conditions when not in a batch file ("global" conditions). If no command is specified, TCC will remove the existing command for the specified condition. Each time an ON statement is defined, it defines a new command to be executed for that event, and any prior command is discarded.

 

If an ON condition is defined for the current batch file, it will override a global ON condition.

 

ON CLOSE [command] - Execute command when the TCC tab is closed.

 

On LOGOFF [command] - Execute command when the user logs off.

 

ON SHUTDOWN [command] - Execute command when the system is being shut down.

 

ON SUSPEND [command] - Execute command when the system is going to sleep or hibernation. Windows will continue suspending after a maximum of 2 seconds.

 

ON RESUME [command] - Execute command when the system resumes after sleeping or hibernating.

 

/G - Set a global condition. This is useful when you want to set global conditions from a batch file. For example:

 

ON /G LOGOFF command

 

PAUSE

 

/T - Displays a countdown timer.  Must be used with /Wn, which must precede /T.

 

SET

 

Array variable assignment and display now support arithmetic expressions (for example, "set %myarray[%i*3]=somevalue").

 

SETARRAY

 

You can initialize arrays by appending [value] to the definition. For example, to initialize all of the array elements to 0:

 

setarray myarray[100] [0]

 

TPIPE

 

The TextPipe engine has been updated to version 11.7.5.

 

 

New Commands:

 

COMMANDS

 

Display, enable, or disable the TCC internal commands. The syntax is:

 

COMMANDS [/D /E /P] commandname ...

 

If you do not enter any arguments, COMMANDS will display all of the internal commands. Disabled commands will be enclosed in parentheses. If you enter command names without a /D or /E, COMMANDS will show the current state of those commands.

 

/D - Disable one or more commands. If you do not provide any command names, COMMANDS will display all of the disabled commands.

 

/E - Enable one or more commands. If you do not provide any command names, COMMANDS will display all of the enabled commands.

 

/P - Pause after displaying each page.

 

DNS

 

Display the DNS records for the specified DNS server and host domain. The syntax is:

 

DNS [/Nh] server hostname

 

/Nh - Don't display the columns header

 

server - The address of the DNS server

 

hostname - The host domain to query

 

For example:

 

DNS 1.1.1.1 jpsoft.com

 

NOTIFY

 

Send an activity notification request to Take Command. This can be useful to detect when a long-running process is waiting for input or has finished (/S) or when a process has started (/A). (This command is only useful when TCC is running in a Take Command tab window.) The syntax is:

 

NOTIFY repeat [timeout] [/A /S] [command...]

 

repeat - The number of repetitions. This can be an integer value from 1 to n, or the string FOREVER. Set repeat to 0 to disable notifications.

 

timeout - The number of seconds before triggering a notification. The default value is 15.

 

/A - Activity notification. When Take Command updates the tab window, it checks to see if the time since the last update is >= timeout, and if so it will execute the specified command. If no command is specified, /A will turn off activity notification.

 

/S - Silence notification. timeout is the number of seconds without any display output before Take Command will execute the specified command. If no command is specified, /S will turn off silence notification.

 

command - The command to execute on an activity / silence match

 

The command will be executed by Take Command, not TCC. So if you specify a command that writes to STDOUT or STDERR (not recommended!), you will see the output mixed with the output from TCC in that tab window.

 

THREAD

 

Execute a command in a separate thread. The syntax is:

 

THREAD command [args]

 

It is the user's responsibility to ensure that there are no I/O or file system  conflicts when running multiple THREAD commands and/or running THREAD simultaneously with commands in the primary TCC thread.

 

THREAD will set the internal variable _thread_result to the return value of command.

 

TOAST

 

Displays Windows Toast notifications, a popup window that appears on the lower right corner of the display. Unlike message boxes, Toast popups are not modal and will disappear after a few seconds. Windows will not display Toast notifications if the user has disabled notifications, either for TCC or everywhere.

 

The syntax is:

 

TOAST /template=n /text1="text" [options]

 

TOAST sets two internal command variables:

 

_toast
0 - no toast active or no user response yet

1 - user clicked on the toast

2 - user dismissed the toast
3 - toast timed out
4 - application hid the toast
5 - toast was not activated
6 - toast failed
7 - system does not support toasts
8 - unhandled option
9 - multiple texts were provided
10 - toast notification manager initialization failure
11 - toast could not be launched

 

_toast_action

0 - user has not clicked on a button

1 - user clicked on first button

2 - user clicked on second button

3 - user clicked on third button

 

The TOAST command exits after calling Windows to display the Toast notification. Windows will call back to TOAST with the Toast results and actions, so the _toast and _toast_action variables will not be set until the user either clicks on the Toast or it times out.

 

The TOAST options are:

 

/action="text" - You can have one or more actions. Each action creates a button on the Toast window; clicking on that button will set the _toast_action internal variable.

 

/attribute="text" - Attribution text displayed on the bottom of the Toast window.

 

/audio=n - Windows system sound to play when the notification is displayed.

0 - DefaultSound

1 - IM

2 - Mail

3 - Reminder

4 - SMS

5 - Alarm

6 - Alarm2

7 - Alarm3

8 - Alarm4

9 - Alarm5

10 - Alarm6

11 - Alarm7

12 - Alarm8

13 - Alarm9

14 - Alarm10

15 - Call

16 - Call1

17 - Call2

18 - Call3

19 - Call4

20 - Call5

21 - Call6

22 - Call7

23 - Call8

24 - Call9

25 - Call10

 

/audiostate=n - Specifies whether you want to display the sound (see /audio above) once, looping, or not at all.

0 - Default

1 - Silent

2 - Loop

 

/duration=n - The time to display the Toast notification

0 - Default

1 - Short

2 - Long

 

/expire=n - Number of seconds before the notification expires.

 

/image="pathname" - The image file you want to display (for template types 0 - 3)

 

/template=n - The type of Windows Toast you want to display:

0 - An image on the left, and a string that occupies a maximum of three lines

1 - An image on the left, a bold string on the first line and a second string wrapped across the second and third lines.

2 - An image on the left, a bold string on the first and second lines, and a second string on the third line.

3 - An image on the left, a bold string on the first line, a second string on the second line, and a third string on the third line.

4 - A string that occupies a maximum of three lines

5 - A bold string on the first line and a second string wrapped across the second and third lines.

6 - A bold string on the first and second lines, and a second string on the third line.

7 - A bold string on the first line, a second string on the second line, and a third string on the third line.

 

/S - Create the shortcut to TCC required for Toast notifications. (Not valid with any other options.) This is normally done by the installer, so you shouldn't need to run TOAST /S unless the shortcut was removed.

 

/text1="text" - Text to display in the first line (template types 0 - 7).

 

/text2="text" - Text to display in the second line (for template types 1, 2, 3, 5, 6, and 7)

 

/text3="text" - Text to display in the third line (for template types 3, and 7)