How to? What am I doing wrong/not understanding?

May 24, 2010
855
0
Northlake, Il
I realize that this is kind of a beginner question but because I was brain-damaged some time ago I am now effectively somewhat of a beginner. You see the hard drive on my laptop died and had to be replaced. While I had almost obsessively backed up my data files, I was less obsessed by program files and directories since one has to re-install most programs anyway so the setup programs can write to the registry. So I had (and still have - it was backed up) a TCSTART.btm file in a directory in my path. (This is guaranteed to be true because I can execute it by issuing a "TCSTART" command). However it is not being executed on Take Command/TCC start up - and this is also guaranteed to be true because the last command in the file is a CDD to the D: drive which is not happening. What am I doing wrong/not understanding?
 
Jun 2, 2008
359
4
I don't believe that simply having it somewhere in the path will work, partly because it may be TCSTART that defines the path. If you haven't specified its location on the Startup tab of the Properties (type option and hit Enter), then I think it has to either be in the installation directory (old school, but that's where I stick mine) or under your profile at C:\Users\<username>\AppData\Local\JPSoft.
 
May 24, 2010
855
0
Northlake, Il
Well setting the TCStart/TCExit path in the option dialog worked, however it TCC will only execute .btm and not .bat files. I find this strange because I certainly don't remember setting up anything like this in the past; in fact I don't even know where it is set - I looked in the all if the tabs in the OPTION dialog and couldn't find it anywhere. I must admit I find this kind of strange.
 
Jun 2, 2008
359
4
I'm glad you got it working. :) .BTM files are TCC's native extension, so I'm sure that behavior is normal.
 
May 24, 2010
855
0
Northlake, Il
Thank you Tea-Time for answering the question as it was asked, but excuse me in my current level of incredible incompetence I got it backwards. I can execute .bat files but not .btm files which are TCC's native extension as you say.
 
Jun 2, 2008
359
4
No problem! How are you trying to execute them? I believe running them from within TCC should just work, no? You said that TCCSTART.btm did run manually because it was in the path... Perhaps you need to configure the associations so you can double click them in Windows Explorer? There's a file called tccbatch.btm in the installation directory, which should run from a TCC prompt and will prompt to associate TCC with .BAT, .BTM and .CMD files.

Or perhaps you mean that TCC isn't doing filename completion for .btm files? If that's the case, then you might have PathExt enabled on the Startup tab of the Properties, but you don't have the .BTM extension added to the PATHEXT environment variable. I suggest reading up on that setting to determine which bahavior you want.
 
May 24, 2010
855
0
Northlake, Il
Running them from TCC does not work which is precisely the (strange) problem I am having. And running tccbatch.btm did not fix the problem, nor does manually doing what tccbatch.btm does fix the problem. Behold:
Code:
D:\DOS]dir Test.bat /f
D:\DOS\Test.bat
[D:\DOS]test
Test
[D:\DOS]ren Test.bat Test.btm
D:\DOS\Test.bat -> D:\DOS\Test.btm
  1 file renamed
[D:\DOS]dir Test.btm /f
D:\DOS\Test.btm.
[D:\DOS]test
TCC: Unknown command "test"
[D:\DOS]assoc .btm=TCC.Batch
[D:\DOS]ftype TCC.Batch="%_cmdspec" /c "%%1" %%*
[D:\DOS]test
TCC: Unknown command "test"
[D:\DOS]
As you can see doing the association manually doesn't fix the problem. I suppose I can manually rename the 170 (an exact count) .btm files I have to .bat, but I'd really rather not do that because I actually use the .bat extension for the (very few - only five) batch files that I have that are meant to be run from cmd.exe.
 
Jun 2, 2008
359
4
Ok, then the problem should be the PathExt option on the Startup tab is checked, but .BTM isn't in your PATHEXT environment variable, so it won't run them. From the help for the PATHEXT environment variable:

Caution: If you set the PathExt configuration option, and fail to set the PATHEXT variable, path searches without an explicit extension will fail as there will be no extensions for which to search! (WindowsXP does define a default value for the PATHEXT variable.) If you set the PathExt configuration option but do not create or modify the PATHEXT variable, TCC will use the one defined by Windows (if any), which will probably not include the .BTM, .REX, .REXX, .PL, .RB, .PY, or .TCL extensions.
 
May 24, 2010
855
0
Northlake, Il
Thank you Tea-Time, I don't understand how these things happened (PathExt checked in the Option dialog but no PathExt variable) but creating a proper PathExt variable (also including .exe) fixed the problem. And Vince I don't know where the dot after the .btm came from if it was on the test sample at all (I have no way of knowing whether I added that dot when I tried to execute the command because that was in a TCC session with local history that I have since terminated). But thank you for noticing; the problem is fixed now.
 
Similar threads
Thread starter Title Forum Replies Date
M What am I doing wrong? Support 12
M What am I doing wrong here? Support 2
M What am I doing wrong in this (very simple!) code? Support 3
M How to? Missing closing quote: What am I doing wrong???? Support 7
fishman@panix.com V23 cdd /s doing WIERD things. Support 5
P Doing math with TCC Support 11
B when doing SFTP via IFTP to my secure site my users always get the finger print key prompt Support 1
C take command 19 not doing well under windows 10 build 14295 Support 3
fromano Fixed /E not working in TCMD 17.0.40 while doing one way synch Support 1
fromano Fixed TCC crashing inside TCMD 17.0.35 after doing a copy Support 11
M Hotkey-mechanism, for doing something with the current command-line Support 4
M Unexpected Results from Doing Numeric Comparisons... Support 17
vefatica Who's doing the cacheing? Support 6
JohnQSmith New online help file wrong logo Support 7
vefatica @EXECSTR ... TCSTART ... something's wrong! Support 7
R History window wrong size, can't remember size change Support 12
mfarah Fixed The DATE command produces the wrong error message. Support 1
MikeBaas @regsetenv complains "wrong parameter" Support 14
mikea How to? TCC registered to wrong 'entity' Support 5
T @replace -- what is wrong here Support 2
vefatica Fixed KEYSTACK /i with repeat count sends wrong keys Support 7
C ZIP/U compares wrong timestamp Support 13
vefatica @WORDS, often wrong Support 0
vefatica gcd() ... wrong answer, lcm() hangs Support 5
D What is wrong with this code? Support 7
vefatica WAD DIR /HL still gets names wrong Support 16
H Fixed DIR /G returns wrong sizes Support 2
M Another "What is wrong?" Support 8
M What is wrong with this command? Support 4
vefatica Updater says wrong version Support 1
CWBillow Wrong icons keep sticking Support 6
C News link wrong Support 1
C Forum column headings wrong? Support 4
gschizas Installation folder for TCMD x64 15.1 is wrong Support 5
Dan Glynhampton Documentation v15 help: ECHOXERR Help Page Title is Wrong Support 0
vefatica Something wrong with @PID Support 10
J zip wrong central directory signature Support 12
S Fixed _DO_FILES and _DO_DIRS wrong Support 0
B Downloading Updates - Error: Wrong file size?? Support 3
vefatica What's wrong here? Support 2
vefatica Wrong startup file? Support 1
gschizas (minor) Help topic "Colors, Color Names and Codes" is wrong Support 0
T Wrong prompt in Windows command console Support 3
M Where am I going wrong with ALIAS??? Support 7
G Wrong File Size Support 8
vefatica Updating v10: error wrong file size Support 2
S Wrong .INI file used by TCC Support 2
K_Meinhard Wrong sender adress Support 0
MikeBaas Understanding SHIFT Support 3
Roedy How to? Understanding BTM file properties Support 0

Similar threads