Stupid, obvious question - launch a BAT with TC

Nov 2, 2010
8
0
#1
Hi
I've been using this product since it was N-Dos (who remembers that?) and am currently using 4NT which still runs OK on Windows 7. I am looking at TC with some interest, and have installed the demo into a virtual to take a play.

I create a .BAT file, and double click it - but it starts in CMD, not TC. How to I re-route things so my BATs will run in the new environment please?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,588
46
Albuquerque, NM
prospero.unm.edu
#2
Hi
I've been using this product since it was N-Dos (who remembers that?) and am currently using 4NT which still runs OK on Windows 7. I am looking at TC with some interest, and have installed the demo into a virtual to take a play.

I create a .BAT file, and double click it - but it starts in CMD, not TC. How to I re-route things so my BATs will run in the new environment please?
One was is to use ASSOC and FTYPE:

Code:
assoc .bat=batfile
ftype batfile="%_cmdspec" /c "%%1" %%*
 
Last edited:
#3
I think the first line ought to be
Code:
assoc .bat=btmfile
BTW, is it still true that execution of .BAT and .CMD files is much slower than of .BTM files due to reading and executing each command from disk one at a time for the former, but reading the whole .BTM file into internal storage at once?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,588
46
Albuquerque, NM
prospero.unm.edu
#4
I think the first line ought to be
Code:
assoc .bat=btmfile
BTW, is it still true that execution of .BAT and .CMD files is much slower than of .BTM files due to reading and executing each command from disk one at a time for the former, but reading the whole .BTM file into internal storage at once?
Other way around -- I wanted the second line to be

Code:
ftype batfile="%_cmdspec" /c "%%1" %%*
though using 'btmfile' in both lines would work too.

The speed difference depends on the volume where the batch file is stored. On a modern hard drive, you probably won't notice a difference; on a floppy disk you probably will. If the batch file is on a network server (e.g. a login script) the difference can be huge!
 
#5
Yes, either way will work. But wouldn't it be better to have both batfile and btmfile file types available, so you could change the association alone in case there is a .BAT file which is in that 1% that is incompatible with TCC? Personally, the only .BAT and .CMD files on my system are those created by some installer; I only create .BTM files, so I never had to touch the defaults for .BAT and .CMD.
 
Nov 2, 2010
8
0
#6
Weird, though, I'd have thought it would be obvious to associate at least BTM with TC at installation, as nothing else uses them?

I'll try the final version of the commands above and let you know how I get on :)

Cheers for coming back to me

(Update)

OK, I did that. Fine and dandy, it launches TC (tells me I have several days eval left), but all I get is a 'DOS Box' with a prompt eagerly waiting for me to tell it something. If I type the name of the .BTM, it runs OK, but that's not quite what I had in mind. I want an icon on my toolbar that I run to launch my backup for example. Or the option when I RClick a .BAT to have it offer "Run in TC"

All this works fine on 4NT. So either I'm doing it wrong or has the feature been removed as not modern enough, buddy? :)

Or should I be startuing TC and passing it the .BAT like I do now (C:\4NT\4NT.EXE "c:\programs\safety.bat")?
 
Last edited:
Nov 2, 2010
8
0
#8
Ahhhhhh!!! That all makes perfect sense. Go on, you can let yourself have the pleasure of telling me that that was in the manual, I can take it! :)

Cheers Steve. On with the eval for me :) CHAFF
 
#9
Well, technically speaking it is in the README.TXT file, but it is not exactly prominent. It is included only as the very terse description of the TCCBATCH.BTM file under the included files category. It has been too long since using the installer to remember whether or not it gives a hint about the 5 optional use batch files.