Chill plugin for Take Command / TCC / 4NT
Version 1.2.0 2014-10-29
Charles Dye
Purpose:
This plugin provides a quick and intuitive interface to the Windows Task
Scheduler service, much simpler (though far less powerful) than the
SCHTASKS
utility. The plugin adds a single command
CHILL
, which schedules a command to be
run after a specified delay or at a certain time.
Installation:
To use this plugin, copy Chill.dll to some
known location on your hard drive. (If you are using the 64-bit version of
Take Command, take Chill-x64.dll instead.)
Load the plugin with a PLUGIN /L
command. For example:
plugin /l c:\bin\tcmd\test\chill.dll
If you copy the .DLL file to a subdirectory named PlugIns within your Take Command program directory, the plugin will be loaded automatically by each new instance of TCC.
Syntax Note:
The syntax definitions in the following text use these conventions for clarity:
BOLD CODE | indicates text which must be typed exactly as shown. |
CODE | indicates optional text, which may be typed as shown or omitted. |
Bold italic | names a required argument; a value must be supplied. |
Regular italic | names an optional argument. |
New Command:
CHILL
— Run a command after
a specified delay, or at a certain time.
Syntax:
CHILL
FOR
n MINUTES
| HOURS
THEN
[IN
dir]
command
CHILL UNTIL
hh:
mm THEN
[IN
dir]
command
n | the number of minutes or hours until command is run; a positive integer |
hh: mm | a time, in 24-hour format |
IN dir | the working directory for the task; this clause is optional |
command | any valid TCC command |
Command may be any internal or external
command, an alias, a batch file, or even multiple commands separated with
&
signs (or whatever your default command separator is.) If
command contains any “special”
characters — percent signs, command separators, pipes or
redirection operators, escapes — remember to enclose it in
backquotes.
A separate command shell will be started to run command.
This new shell will not inherit anything from the one in which CHILL
was run! If your command depends on aliases
or environment variables, then these must be initialized in TCSTART.BTM or
in command itself. If
command is a batch file or external command
and is not in the search path, be sure to specify the complete pathname.
You can set the working directory for the task with IN
dir.
Use double quotes around dir if it contains
spaces or other special characters. Dir may
be a variable, function, or directory alias (quote it if it might contain
spaces); you can also use .
to start the task in the current
shell’s current working directory. If you don’t specify
IN
dir, the default is wherever
TCC.EXE lives (the COMSPEC directory.)
Keywords are not case sensitive. MINUTES
may be
abbreviated to MIN
; HOURS
may be shortened to HOUR
. FOR
and
THEN
are syntax sugar; both are optional and neither does
anything.
If you use UNTIL
hh:
mm
to specify a time which has already passed, then the job will be scheduled
for that time on the following day. For instance, if you type
CHILL UNTIL 02:00 THEN `DEL "%TEMP\*"`
on Thursday afternoon,
the command will be scheduled for 2:00 Friday morning.
The computer must be turned on and running Windows, and a user must be logged in, when the specified time arrives; otherwise the command will not run.
To shut the computer down after two hours:
chill for 2 hours then reboot /p
To defrag drive C: at 11:30 tonight:
chill until 23:30 then defrag c:
To run a program which requires an environment variable and the working directory set:
chill 1 hour in c:\somewhere `set var=value & c:\bin\util\myprog.exe`
Startup Message:
This plugin displays an informational line when it initializes. The
message will be suppressed in transient or pipe shells. You can disable it
for all shells by defining an environment variable named NOLOADMSG
,
for example:
set /e /u noloadmsg=1
Changes:
1.0.0 | 2011-01-07 | initial release |
1.0.1 | 2011-03-02 | fixed exit code |
1.1.0 | 2011-04-05 | per Dave Cantor, added IN keyword to set working directory |
1.1.1 | 2013-04-24 | converted to Visual Studio 2010; increased the internal buffer size; updated plugin’s web address |
1.2.0 | 2014-10-29 | changes for TCC v17 compatibility |
Status and Licensing:
This plugin is Copyright © 2014, Charles Dye. Unaltered copies of the binary and documentation files may be freely distributed without restriction. I make no guarantee and give no warranty for its operation. Use it at your own risk. If you discover a problem, you can report it in the JP Software support forum.
Download:
You can download the current version of the plugin from http://prospero.unm.edu/dl/chill.zip or ftp://prospero.unm.edu/chill.zip.