Also see the cmdline.txt that comes with the distribution for more info.
Description
I wrote HelpExec so that I can run some Tcl scripts on my PC. True,
after you install Tcl for windows, you can just click on the
Tcl (.tcl) file icon to run the script... but it doesn't always work
that way... for example, I want to be able to view text files
by right clicking on their icons and choose "Send To" to view
them with my editor (www.geocities.com/captain_lion/tedit/), which is
a Tcl/Tk script. I cannot put tedit.tcl (my script) in windows/sendto
directory directly -- because Windows' "Send To" won't invoke my the
Tcl interpreter in that case!
Then I put a link to c:/teditwin/helpwin.exe at windows/sendto directory,
and call it TEdit... Voi la! Whenever I "send to" a file to TEdit,
HelpExec.exe passes the target file to my editor script!
COMMANDLINE "c:/tcl/bin/wish.exe" -f "c:/programs/tcl/tedit/tedit/tcl"
where directive is one of
<directive> <argument> [<argument> ...]
COMMANDLINE
, DIRECTORY
or WAIT,
case sensitive,
described as follow:
In my above example, if I "send to" a file called myfile.txt, here is
what will happen:COMMANDLINE
directive tells HelpExec what to execute. HelpExec
takes this line, appends whatever argument(s) is/are passed to HelpExec,
and executes the line as a windows command line.
DIRECTORY
directive tells HelpExec what directory to execute
the command line
WAIT
directive takes one argument, which is either 0 or 1. 0
signifies HelpExec should not wait for the spawned program to be
input idle before it exits, 1 signifies otherwise.
Just remember, HelpExec knows what command to execute by reading the command
line from the file called "cmdline.txt", which has to reside in the same
directory as HelpExec. That means, if you want two HelpExec running two
different commands, you need to put them at seperate directories so that
they can have seperate cmdline.txt files.
"c:/tcl/bin/wish.exe" -f "c:/programs/tcl/tedit/tedit/tcl"
Feature
Enough about Tcl... it works with everything... It's useful when there is
a file that Windows is going to execute, but is not an executable...
say you want a command executed whenever Windows goes idle. You can do
this by renaming HelpExec.exe to HelpExec.scr and install as screen saver...
and then in the same directory, create a cmdline.txt and specify the
command line you want (remember to use the COMMANDLINE
keyword). Where To Get
Click here to get.
Click here to return to Mark Ng's home page.