Click a .btm file with "TCC Startup Options" in effect.

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jul 4, 2010
4
0
#1
I recently upgraded to v13, but now I'm festering over an old problem I've got about TCC – not the console TCMD, just TCC.

I'm trying to correlate the reality of double left-clicking on a "test.btm" file from my File Manager to start TCC (if that's the right way to say it) with the instructions in the Help "TCC Startup Options" that include:

The command line that starts TCC will typically include the program name with drive and path, followed by any options. For example:
"c:\program files\jpsoft\tcmd13\tcc.exe" @c:\jpsoft\tcmd.ini

The complete syntax for the TCC startup command line is (all on one line):
d:\path\tcc.exe [d:\path] [[/]@d:\path\inifile] [//directive=value...] [/A /H /I[IPSX]/L: /LA /LD /LF /LH /Q /S /T:bf /U /V /X ] [/C | /K] [command]

I want to learn how to invoke the "TCC Startup Options" when I double left-click a "test.btm" file with contents like -

pause In test.btm
start /pgm test2.btm
pause before exit
exit

I'm NOT asking for information about the various command-line options.

I AM asking about how I get them to take effect automatically when I execute the "test.btm", AND when it starts "test2.btm". I want to be able to set a directive or choose an option (/A, or /LA, or /V) and have it be in effect for "test.btm" and "test2.btm".

Mostly, I want to know where that is explained in Help so I can hone my Help-search skills. But, I don't want to be directed to a Help article that'll force me to decide between updating this forum thread or opening a new one...

I know about the TCSTART.btm and I'm using it. I also found the TCMD.ini file.
 
#2
If you want to use different options for a particular btm, you can create a shortcut with the command line you want. If you want all btm files to use the options, then you can modify the Windows file association for btm files.

To set an option for test2.btm, you need to put the whole command line including tcc.exe in your start command, not just "test2.btm". If you do the latter, then Windows uses the file association to construct the command line.
 

samintz

Scott Mintz
May 20, 2008
1,203
11
Solon, OH, USA
#3
From your description, I gather you want different behavior based on the name of the BTM file you click on in Explorer. That would be akin to wanting different versions of MS Word to run when you click on different Word docs.

Windows will apply default behavior for all files of a specific type. The ASSOC and FTYPE will (mostly) determine what happens when you click on a BTM file.

The only way to get specific behavior would be to create a shortcut (.LNK file) that invokes TCC with the actual command you desire.

For example, on my PC, ASSOC and FTYPE are:
[R:\] assoc .btm
.btm=TCC.Batch

[R:\] ftype TCC.Batch
TCC.Batch="C:\tc13\TCC.EXE" /c "%1" %*

So if double click on "foo.btm" in Explorer, it will get launched using the TCC.Batch command line:
"C:\tc13\TCC.EXE" /c "foo.btm"

But I can create a shortcut "foo.lnk" that I can customize with the INI path, and various switches, and command tail:
SHORTCUT "C:\tc13\TCC.EXE" "/c /la foo.btm" "c:\temp" "start foo.btm with local aliases" "foo.lnk" 1

From within your test.btm script, you would do something similar with the START command:
pause In test.btm
start /PGM "C:\tc13\TCC.EXE" /c /la test2.btm
pause before exit
exit
 
Jul 4, 2010
4
0
#4
Thank you for your comments Gentlemen. I have a confession of sorts.

I had been using TCMD/TCC on my Windows XP for a long time (really just TCC - I never use TCMD). I kept using version 11 for the last couple of years because I saw no reason to upgrade to v12 nor v13. About a month ago I decided to get a new 64-bit Windows 7 PC, and I decided to upgrade TCMD/TCC to v13. I was able to recover all of my files from my XP drives, so I was able to start working with TCC in short order.

The first thing I noticed when I executed my first .btm file (by left double-clicking on it) was that the copyright "header" had returned to the TCC windows.

TCC 13.01.31 Windows 7 [Version 6.1.7601]
Copyright 2011 JP Software Inc. All Rights Reserved
Registered to George Harnett

The presence of the header is trivial, but it's also annoying. I say "returned" because 5-6 years ago I figured out how to keep the header from appearing, but now I can't remember how to do it. I couldn't find any notes on how I did it, but I did remember the "TCC Startup Options" stuff from my research into doing it five years ago. The first line in the "Help > TCC Startup Options" is:

The command line that starts TCC will typically include the program name with drive and path, followed by any options. For example:
"c:\program files\jpsoft\tcmd13\tcc.exe" @c:\jpsoft\tcmd.ini

From which I inferred that the "acceptable" way to execute a TCC .btm file was by doing that (along with the other options later described in Help - the header-suppression switch is "/Q"). However, that didn't explain why my .btm files were working just fine by left double-click, execute "start" from another .btm, execute "call" from another .btm, placed in my startup directory, placed in the Windows Task Scheduler, or when executed from a programmable "soft key" in my File Manager (Total Commander) which only executes the .btm file and passes it an argument - usually the path/filename to the selected/highlighted file.

From which it follows that the command-line options must be getting executed somewhere, and I just needed to find out where so I could add the "/Q" option to it. Hence, this Forum thread.

It's clear from your inputs that the power and versatility of the aforementioned command-line command is viable and available, but that it is also more than I want to tackle at this time when a simple "cls" does the trick. I'm intrigued by the "directives" and other options I've read about, but not enough to spend any time exploring them.

If no one can offer a back-door solution for my "header" problem (which I'm pretty sure I used before), I'll check out some lingering 4DOS websites - maybe that's where I learned how to fix it before. I might have done it in the Registry, but I don't know what to do nor where to do it. I know it can be done. I know it's simple to do.
 
#5
Sounds like the way you did it before was that you edited the registry to add /q to TCC.batch. You can do that again. Or, use the ftype command to do the same thing.

Did you run tccbatch.btm after installing TCC? It looks like you did. You can look in that file to see the ftype command that was used. You just need to add /q to it.

Of course, if you run a btm from TCC, you don't see the version/copyright again since TCC is already running.
 
Jul 4, 2010
4
0
#6
My Thanks to everyone who contributed to this thread.

After a lot of scrambling around, I was finally able to suppress the copyright header message when I double left-click a .btm script. I had originally installed the 32-bit TC v13 because of my earlier experience with a Java installation. I had installed the 64-bit Java, but it didn't work. I uninstalled it and installed the 32-but Java, and it worked. That didn't make any sense because my new PC is a $600, 64-bit, HP P7-1174, 2.5 GHz, 4-CPU, 8 GB Ram desktop that was built last September. So, to be safe I originally installed the 32-bit TC v13 - that's the one whose copyright message is in my earlier Forum thread updates. But, I knew I needed to install the latest 64-bit TC version (v13.02.35) so I installed it after David's second (Dec 21st, #5) thread update (the one before this one). The installation detected the 32-bit version and I opted to have it removed. I ran my little "test.btm - start /pgm test2.btm" test and the "header" was still there, but it now displayed "TCC 13.02.35 x64". I tried David's change to tccbatch.btm, and it added the "/q" in all of the appropriate places in the Registry. I executed test.btm and the header was still there. I executed it from a TCC window opened as an Administrator, but the header was still there. I did a power off/on reboot and the same thing happened. Then I discovered the 32-bit TC v13 still installed and fully functional. I uninstalled both TCs, and searched the Registry for "JPSoft" entries, of which there were many including the ones with the "/q" addition. I ran a Registry Cleaner application (RegCleanerPro) and there were still a few JPSoft entries, including those with the "/q" additions. Fine. I reinstalled the 64-bit TC v13 and the "/q" additions were gone. I ran the modified tccbatch.btm and they returned. I double-clicked the test.btm and the copyright header was conspicuous only by its absence.

This "header" issue is extremely trivial, but I expected it to provide a simple exercise in how to utilize the "TCC Startup Options" which was the only thing I could find in "Help" about executing a .btm script outside of TCMD. I thought suppressing the copyright header would be a good way to learn how to implement the options. Wrong. Still, I got a lot of good ideas on how to do a limited implementation of them from the updates to this Forum thread, and for those hints I am greatly appreciative.
 
Jul 4, 2010
4
0
#8
Well, in a manner of speaking I guess. My original consternation was that I never found, nor did any Forum thread-update direct me to, anywhere in Help that talked about double-clicking a .btm script from within a Windows File Manager, let alone putting a .btm in one's Startup directory or in the Windows Task Scheduler. I have been executing .btm scripts in those manners for several years. In particular, I couldn't find anything in Help stating that double-clicking a .btm script was an acceptable way of executing one. My Forum Username is a hint that I've been using TC since it was 4DOS and was distributed on 4.25" floppies with the license printed on an attached label. I knew double-clicking a .btm worked; I knew it was acceptable; I just didn't know how to implement the "TCC Startup Options" - in particular one trivial one that I forgot how to do. I was able to suppress the copyright header thanks to the modified tccbatch.btm trick. I don't know if that will work with the other switches or the directives, and I hope I never have to find out.

If that's consistent with "it worked as ... Help said it would", then Yes: it worked as Help said it would.
 

rconn

Administrator
Staff member
May 14, 2008
10,096
85
#9
My original consternation was that I never found, nor did any Forum thread-update direct me to, anywhere in Help that talked about double-clicking a .btm script from within a Windows File Manager, let alone putting a .btm in one's Startup directory or in the Windows Task Scheduler.
That's standard Windows behavior, for any extension that has an association. (Which is almost all of them.)

The Take Command help doesn't cover normal Windows or Explorer functionality. (Of course, Microsoft doesn't either, but that's their responsibility, not ours!)