Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Batch file won't run if there is already an instance of TC 17 running

Feb
7
0
Probably another newbie question (to recap I stayed a t Take Command version 8.02.92 for a long time and I have only recently jumped to V17) . I've had the following odd behavior when double clicking a .bat file with windows explorer (Win7 Pro): If there are no instances of TC running, then an instance of TC opens and the batch file runs. All is well with the world. This is the same behavior as under V8. However if there is already a TC v17 window open, and I double click on the batch file from Explorer, what I get is the hourglass which remains until I close the first instance of TC. Then another instance will usually (but not always) open and run the batch file. V8 did not care. I could have one instance of TC open to do something and it would not impact any other instance needed to run a batch file. Is there any setting or way to get that behavior back? Thanks.
 
Are you saying that double-clicking on a batch file launches Take Command (the graphical program with all the tabs), or TCC (the console program)? And what kinds of batch files -- .BTM, .BAT, .CMD? It might be helpful to see the associations for those file types.
 
Yes, it launches the graphical program with all the tabs. My file associations are:

.bat = Take Command (TCMD.EXE)
.btm = Take Command
.cmd = Take Command

Which are my old TCMD V8 associations carried over. This was all occuring on a .bat file I happend to be working on for an install package. Batch files for my own use are all .btm. Batch files for others running plain vanilla windows (no JPSoft products) are .bat. I don't use .cmd much. I ran a quick test on a .btm file and the behavior seems similar.
 
Do you want/expect a second instance of tcmd.exe?

Options ... TakeCommand ... Windows ... uncheck "single instance"
 
Thanks. The "single instance" property has never been checked except for once as a test, but it did not matter. Should TCMD.EXE be capable of supporting more than one instance if my file association points to it? Comparing v8 with v17 I see evidence of a paradigm shift. v8 does not have tabs and does not have all the toolbar & menu clutter that v17 has. I've been assuming that the relationship between TCMD and TCC was similar to that of TCMD to 4NT under version 8, but perhaps that was a mistake. Am I attempting to use TCmd.exe in a way that it is no longer suited for? It it more of a gui for TCC now? Should I shift all my file associations over to TCC.EXE?
 
"Paradigm shift" is exactly right; it happened with version 9 IIRC. Yes, I would suggest associating batch files with TCC. (Or associating .BTM files with TCC, .BAT and .CMD files with CMD.EXE; many many batches out there on the interwebs do nasty things that cause compatibility issues.)
 
In fact, TCMD alone can't even run one instance of the file. TCC runs them. TCMD just shows TCC (perhaps many TCCs) in tabs.

Hmmm! I have 4NTv8 here (8.02.106), but I don't have any GUI EXE in my installation (no TCMD). Should I have one? I have archived a 4nt802.exe with an installer icon. How do I extract the missing EXE from the distribution file?
 
"Paradigm shift" is exactly right; it happened with version 9 IIRC. Yes, I would suggest associating batch files with TCC. (Or associating .BTM files with TCC, .BAT and .CMD files with CMD.EXE; many many batches out there on the interwebs do nasty things that cause compatibility issues.)

Thanks. That begins to make sense now. I'll change the file associations and live with it for awhile. Is there a way to run a .btm file and make it open a new tab in the running instance of the TCMD gui instead of opening a new TCC window?
 
With TCMD configured for "single instance", from a TCC command line, the following command:

Code:
g:\tc17\tcmd /t g:\tc17\tcc /k v:\avtemp.btm

will either start TCMD (if it's not already running) with the BTM running in the default tab

or (TCMD not already running) open (and switch to) a new tab and run the BTM there.

So I suspect a file association command like the one above, with appropriate paths, and with the BTM's name replaced by "%1" (or something like that) would have the same effect. There are others better qualified than I am to help with file association commands.
 
Tested: This works nicely here as the default value in HKEY_CLASSES_ROOT\TCC.Batch\SHELL\OPEN\COMMAND.
Code:
 g:\tc17\tcmd.exe /t g:\tc17\tcc.exe /k "%1" %*
You can't supply parameters (%*) to the BTM when double-clicking on it in Explorer, but you can from the Start\Run box.
You'll need to adjust the paths.
 

Similar threads

Back
Top