- Jun
- 137
- 3
Here is my tcstart.btm. When I start up a new TCC.exe window, sometimes it runs to completion, leaving me a new TCC window, and sometimes it simply goes POOF! I added debugging to it so I could tell when it's exiting, and when it fails, it's always after creating debugJPc.txt. That makes no sense at all to me, especially since it creates JPc and then JPd consecutively, with no other code in between them. But that is the cessation point, every time. Yet sometimes it runs to success.
Note also that if I remove tcstart.btm from the TCMD directory, TCC always starts up with no problems.
Any ideas what might be wrong, or how I might better troubleshoot it?
@echo off
: TCSTART.BTM / 4START.BTM
:
: This is executed each time a copy of TC/4NT is loaded. You can also create
: TCEND.BTM (4END.BTM) to execute when TC/4NT is exited.
on error gosub ErrorHandler
echo Executing %0
pushd %@path[%comspec]
echo a > c:\wip\debugJPa.txt
unalias *
echo b > c:\wip\debugJPb.txt
alias /r %@name[%comspec].als
echo c > c:\wip\debugJPc.txt
echo d > c:\wip\debugJPd.txt
unfunction *
function /r %@name[%comspec].fns
if exist %COMPUTERNAME%.fns function /r %COMPUTERNAME%.fns
popd
echo e > c:\wip\debugJPe.txt
iff %@name[%comspec] == TCC then
rem remove zip and unzip internal commands
setdos /i-zip
setdos /i-unzip
endiff
echo f > c:\wip\debugJPf.txt
iff "%@search[FixPrompt.btm]" != "" then
call FixPrompt
else
set titleprompt=`%_cwd`
prompt [$t]-$g
endiff
echo g > c:\wip\debugJPg.txt
set COLORDIR=offline: black; hidden system:bright red; rdonly: bright black; dirs:bright green; com exe bat btm cmd vbs vbc js:bright yellow; zip arc arj lha cab tar z:bright magenta; c cs cpp h hpp rc odl mc frm bas cls ctl rul wbt:bright white
echo h > c:\wip\debugJPh.txt
set .vbc=%SystemRoot\system32\cscript.exe /nologo
if "%@search[isdev.exe]" != "" set .ism=start %@MaybeQuote[%@search[isdev.exe]]
echo i > c:\wip\debugJPi.txt
if %@instr[0,1,%@verinfo[%comspec%]] GT 6 alias pdir=*pdir /d
echo j > c:\wip\debugJPj.txt
if exist %COMPUTERNAME%.als alias /r %COMPUTERNAME%.als
echo k > c:\wip\debugJPk.txt
if (%_transient == 1 .OR. %_pipe == 1) quit
echo l > c:\wip\debugJPl.txt
if "%@search[env.btm]" != "" call env.btm
echo m > c:\wip\debugJPm.txt
rem no need to worry about restoring drives on second TC/4NT window
REM tasklist tcc > clip:
REM iff "%@clip[1]" == "**EOC**" then
REM call RestoreDriveMappings
REM endiff
setarray _TCCinstances[10]
echo %@execarray[_TCCinstances,tasklist tcc] >& nul
iff %_EXECARRAY == 1 then
call RestoreDriveMappings
endiff
unset /q _TCCinstances
echo n > c:\wip\debugJPn.txt
:end
kill c:\wip\debugJP*.txt
quit
:ErrorHandler
echo Error received: ? = %?, _? = %_?, _SYSERR = %_SYSERR
return
Note also that if I remove tcstart.btm from the TCMD directory, TCC always starts up with no problems.
Any ideas what might be wrong, or how I might better troubleshoot it?
@echo off
: TCSTART.BTM / 4START.BTM
:
: This is executed each time a copy of TC/4NT is loaded. You can also create
: TCEND.BTM (4END.BTM) to execute when TC/4NT is exited.
on error gosub ErrorHandler
echo Executing %0
pushd %@path[%comspec]
echo a > c:\wip\debugJPa.txt
unalias *
echo b > c:\wip\debugJPb.txt
alias /r %@name[%comspec].als
echo c > c:\wip\debugJPc.txt
echo d > c:\wip\debugJPd.txt
unfunction *
function /r %@name[%comspec].fns
if exist %COMPUTERNAME%.fns function /r %COMPUTERNAME%.fns
popd
echo e > c:\wip\debugJPe.txt
iff %@name[%comspec] == TCC then
rem remove zip and unzip internal commands
setdos /i-zip
setdos /i-unzip
endiff
echo f > c:\wip\debugJPf.txt
iff "%@search[FixPrompt.btm]" != "" then
call FixPrompt
else
set titleprompt=`%_cwd`
prompt [$t]-$g
endiff
echo g > c:\wip\debugJPg.txt
set COLORDIR=offline: black; hidden system:bright red; rdonly: bright black; dirs:bright green; com exe bat btm cmd vbs vbc js:bright yellow; zip arc arj lha cab tar z:bright magenta; c cs cpp h hpp rc odl mc frm bas cls ctl rul wbt:bright white
echo h > c:\wip\debugJPh.txt
set .vbc=%SystemRoot\system32\cscript.exe /nologo
if "%@search[isdev.exe]" != "" set .ism=start %@MaybeQuote[%@search[isdev.exe]]
echo i > c:\wip\debugJPi.txt
if %@instr[0,1,%@verinfo[%comspec%]] GT 6 alias pdir=*pdir /d
echo j > c:\wip\debugJPj.txt
if exist %COMPUTERNAME%.als alias /r %COMPUTERNAME%.als
echo k > c:\wip\debugJPk.txt
if (%_transient == 1 .OR. %_pipe == 1) quit
echo l > c:\wip\debugJPl.txt
if "%@search[env.btm]" != "" call env.btm
echo m > c:\wip\debugJPm.txt
rem no need to worry about restoring drives on second TC/4NT window
REM tasklist tcc > clip:
REM iff "%@clip[1]" == "**EOC**" then
REM call RestoreDriveMappings
REM endiff
setarray _TCCinstances[10]
echo %@execarray[_TCCinstances,tasklist tcc] >& nul
iff %_EXECARRAY == 1 then
call RestoreDriveMappings
endiff
unset /q _TCCinstances
echo n > c:\wip\debugJPn.txt
:end
kill c:\wip\debugJP*.txt
quit
:ErrorHandler
echo Error received: ? = %?, _? = %_?, _SYSERR = %_SYSERR
return