Welcome!

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

SignUp Now!

(Solved) TCC seems to only be running DOS commands, but not TCC commands

Apr
10
0
Symptom:
A script ending in QUIT will not exit and close the window. The script will run, but at the end, it exits to the command prompt, leaving the window open. Replacing 'QUIT' with 'EXIT' will close the window.
The same script run on another PC will work as expected.

background: we have several scripts that have been in uses for some time by multiple people on multiple PCs. on this PC, they all act as described above.

TCC 31.01.22 x64 Windows 10 [Version 10.0.19045.4291]
TCC Build 22 Windows 10 Build 19045
 
QUIT ends a BAT/BTM. EXIT terminates TCC. QUIT would terminate TCC if TCC was transient (started with "/C").
 
Try these commands. They say what Explorer does when you 2-click on a BTM.

Code:
v:\> assoc .btm
.btm=TCC.Batch

v:\> ftype tcc.batch
tcc.batch="D:\tc31\tcc.exe" /c "%1" %*

If you see the "/C" on the TCC command, the TCC running the BTM will be transient and will exit when the BTM terminates.

If "/C" isn't there, the TCC running the BTM will not be transient. It will keep running after the BTM quits.
 
Thank you again.
assoc .btm
returns
.btm=TCMD.Batch

ftype tcc.batch
returns
tcc.batch="C:\Program Files\JPSoft\TCMD31\tcc.exe" /c "%1" %*

For troubleshooting, I made a very simple .btm file containing the following:

@echo off

color 14 on 0 & echo Test 1, 2, 3
echo ``
color YELLOW on BLACK
pause /w1
color

QUIT

The result of this is the following:
1714481394306.png


The window stays open.

The same .btm file run on the other computer closes after displaying the
Press any key when ready...
assoc.btm returns .btm=TCC.Batch on the working computer.
 
Now it's getting strange! Do you have TCSTART.BTM files? Could anything in them start (or not start) a non-transient TCC? You might try putting ECHO %_PID in the test BTM file and then, when you have dismissed the PAUSE and the window doesn't close, ECHO %_PID at the command line to see if it's really the same TCC.
 
Here is the result of adding the ECHO %_PID to the test file, and then entering at the command line. The file does not PAUSE and wait for entry, it pauses for a moment after Press any key when ready... then dumps to the command line.
Test 1, 2, 3

30192
Press any key when ready...

[C:\Users\jbeard\Desktop]ECHO %_PID
30192


I've done a search for 'TCSTART.BTM, and came up empty on the PC. The exact set of batch files I'm having issues with on this PC works as expected on the other PCs and for other users.

I don't know if this adds anything or not, but at one point, I installed Power Shell Core following an online tutorial, the exact version eludes me right now, then later uninstalled it.
I've also installed and removed Take Command. Take Command was initially installed during the laptop setup, then uninstalled during this troubleshooting.

Is there a command to associate the .btm files with TCC vs TCMD? I've used the Open With dialog to set TCC as the default, but the output of assoc .btm is still .btm= TCMD.Batch.
 
That did change the output of assoc .btm to .btm = TCC.Batch, but behavior is the same. :-)
I appreciate all the help so far.
 
I'm running out of ideas. What happens if you use the Run dialog (Win+R)? Try "C:\Program Files\JPSoft\TCMD32\tcc.exe" /c ... "C:\Program Files\JPSoft\TCMD32\tcc.exe" /c pause ... "C:\Program Files\JPSoft\TCMD32\tcc.exe" /c [path to test BTM].

And there seems to be a mixture of TCC v31 and TCC v32 here.
 
Apologies on the TCC V31/V32 intermingle. Initially I started with V32, removed that and installed V31 to match up with others using the same files. That was removed and V32 was installed this morning.
"C:\Program Files\JPSoft\TCMD32\tcc.exe" /c - Window quickly opens then closes in less than 1 second
"C:\Program Files\JPSoft\TCMD32\tcc.exe" /c pause - Window opens, then pauses with Press any key when ready..., then closes when any key is pressed.
"C:\Program Files\JPSoft\TCMD32\tcc.exe" /c [path to test.btm] - Window opens, runs the test scrip, pauses for a moment, showing similar to below, then closes. This is the behavior I've been looking for!
Test 1, 2, 3

30192
Press any key when ready...
 
Correct, double clicking does not produce expected result.
I tested another batch file from the Run Dialog pointing to "C:\Program Files\JPSoft\TCMD32\tcc.exe" /c [batchfile.btm] and it seemed to work as expected.

Que light bulb moment: right clicking the .btm file and selecting 'Look for another app on this PC, then browsing to "C:\Program Files\JPSoft\TCC32" and selecting TCC.exe. now it behaves (mostly) how it should: runs the script, then window closes when done. Tested on a couple of other existing scripts, seems to be working!

So simple, yet so elusive.

Thank you Vince!
 
I'm curious! Having let Windows do that, what do assoc .btm and ftype %@assoc[.btm] show?
 
Now I kind of want to know why the TCCBATCH.BTM didn’t work. Maybe because it wasn’t associated with .BTM to begin with?

Thanks again for walking me through this.

Cheers!
 
Thank you again.
assoc .btm
returns
.btm=TCMD.Batch

ftype tcc.batch
returns
tcc.batch="C:\Program Files\JPSoft\TCMD31\tcc.exe" /c "%1" %*

I notice that ASSOC returned a filetype of TCMD.Batch, but the filetype you are using in the second command is tcc.batch.
 
^^ noticed that too.

Also, an easy answer is that you somehow have a botched %ComSpec% setting. Double-clicking bat/btm file on desktop SHOULD just run it and exit. And that's not related to using QUIT or EXIT.
 
The issue was resolved by right clicking the .btm file and selecting 'Look for another app on this PC, then browsing to "C:\Program Files\JPSoft\ TCC 32" and selecting TCC.exe.

Cheers
 

Similar threads

Back
Top