Just a minor annoyance re one particular plugin...

#1
As is typical for me, the best way to demonstrate the problem is to show the very short output of a segment of a TCC session:
Code:
[Z:\]Type Stuff.txt
Stuff
 
[Z:\]Type Stuff.txt | Tee CON: | Type
TCC: Plugin already loaded "4UTILS"
Stuff
TCC: Plugin already loaded "4UTILS"
Stuff
The above command sequence was invented solely to illustrate the problem, it is (hopefully obviously! ;)) not something I do on a regular basis.

And as you can see the "Plugin already loaded" message is produced for every subsequent command in a series of commands.

As I said, not a major problem but a minor but very consistent annoyance.
 
May 29, 2008
529
3
Groton, CT
#3
As is typical for me, the best way to demonstrate the problem is to show the very short output of a segment of a TCC session:
Code:
[Z:\]Type Stuff.txt
Stuff
 
[Z:\]Type Stuff.txt | Tee CON: | Type
TCC: Plugin already loaded "4UTILS"
Stuff
TCC: Plugin already loaded "4UTILS"
Stuff
The above command sequence was invented solely to illustrate the problem, it is (hopefully obviously! ;)) not something I do on a regular basis.

And as you can see the "Plugin already loaded" message is produced for every subsequent command in a series of commands.

As I said, not a major problem but a minor but very consistent annoyance.
Change your
Code:
plugin /l 4utils
to
Code:
if not plugin 4utils plugin /l 4utils
 
#4
Guys, I have plugins directories (more on that in a second) and no TCStart.btm files at all. Therefor Dave, I do not use a "Plugin" command. There are two single plugin directories that are symbolically linked to the directory for the version of that TCC I am running at any particular point int time. And I run both 32-bit and 64-bit TCC sessions somewhat transparently to me (as in I don't really think about it much) because I have some programs that I wrote years ago that I use regularly that are not particularly happy when run from a 64-bit TCC session and since I no longer have the source for them - I lost a hard drive some time back - I am not going to rewrite them from scratch for 64-bit Windows. And I just noticed that this only happens in 32-bit TCC which is configured, as far as I know/can tell, exactly the same way as 64-bit TCC is configured except for being contained in the X86 program files directory.
 
#5
I wrote 4UTILS and I'l pretty sure it (no plugin, in fact) could cause that error message (short of telling its host TCC to load itself ... a rather dumb thing to do).

My suspicion is the same as Dave's ... there's a "PLUGIN /L" hiding somewhere.

Hmmm! ... how else could that message be generated? ... if you had 4UTILS.DLL and a copy of 4UTILS.DLL both in your plugins directory. That seems unlikely. Short of an explicit "PLUGIN /L" I can't think of another way to get that message.
 
#6
Well Vince I have to take your word for it given that you wrote the thing. :) But I was just barely aware that the "Plugin" command even existed, and I just looked in the X86 program files directory on my C: drive ...
Code:
[C:\Program Files (x86)]PDir /(dy/m/d th:m:s zc fpn) /S /A TCS*.b* | Sort
2012/06/04 09:25:09          1,482 C:\Program Files (x86)\JPSoft\Plugins\TCStart.V2012-06-04.btm
2012/06/04 09:25:09          1,482 C:\Program Files (x86)\JPSoft\TCMD15.15.01.44\Plugins\TCStart.V2012-06-04.btm
2012/06/04 09:25:09          1,482 C:\Program Files (x86)\JPSoft\TCMD15\Plugins\TCStart.V2012-06-04.btm
... and all of these TCStart's are both very old and have date-qualified names (actually there's only one of them because the two JPSoft version Plugins directories are symbolically linked to the common "JPSsoft\Plugins" directory) so I wouldn't have a clue how they are even being loaded, and that one TCStart.btm doesn't even contain a "Plugiin" command. Is there somewhere else I should look?

However, there's something else I should note here that may be relevant: All of my TCC sessions are identified in the title bar as to whether they are 32- or 64-bit, and the title bar contains their PID. I have no recollection how I accomplished that, and while I think it's rather unlikely that may have something to do with it (the same is true for 64-bit TCC sessions where again I have no problems).
 
#7
I have no further ideas about the plugin message. I doubt your title is relevant. A common way to get _PID into the window caption is with the TITLEPROMPT environment variable. Try SET and see if you see it. Then try SET /U and SET /S. If you see it with SET but not with either SET /U or SET /S, then TITLEPROMPT is likely being set in a TCSTART file. Did you look elsewhere for TCSTART files? They could be anywhere; the path to TCSTAR/TCEXIT is specified in the OPTION dialog (Startup tab). Perhaps you have an old INIfile that specifies an old location for TCSTART/TCEXIT.

P.S., That's a mistake I make about once a year ... install a new version in g:\tcN+1 and copy the INIfile, TCSTART.BTM, and TCEXIT.BTM from g:tcN ... then I make changes to the new TCSTART and find thay they don't work because the new INIfile (a copy of the old one) points to the old TCSTART/TCEXIT files.
 
#8
Vince, remember I have medically-diagnosed very bad memory; it is the primary reason I am considered to be disabled. I couldn't find a TCC ini file anywhere on the C: drive, either, although I am obviously setting the TITLEPROMPT somewhere because it's set on a per-TCC-instance basis but I no longer remember where/how I did that. Again, while anything is possible I'd be very surprised that I'd used the Plugin command anywhere because I only barely (at least now) knew of its very existence. Thank you for your assistance; I'll continue to look into it on a low-priority basis and I'll post it here if I ever find the answer (assuming I remember!).
 
#9
Vince, remember I have medically-diagnosed very bad memory; it is the primary reason I am considered to be disabled. I couldn't find a TCC ini file anywhere on the C: drive, either, although I am obviously setting the TITLEPROMPT somewhere because it's set on a per-TCC-instance basis but I no longer remember where/how I did that. Again, while anything is possible I'd be very surprised that I'd used the Plugin command anywhere because I only barely (at least now) knew of its very existence. Thank you for your assistance; I'll continue to look into it on a low-priority basis and I'll post it here if I ever find the answer (assuming I remember!).
You shouldn't have to search for an INI file. Just give the command "echo %_ininame"; TCC will tell you what INI file it was started with. Remember how some things work:

1. TITLEPROMPT only works if it's in the environment. That cannot be done with TCMD.INI. It can be done once and for all time by setting it in the user (SET /U) or system (SET /S) environment; all apps get those environments. Or it can be done every time TCC starts via a SET command in a TCSTART file.

2. TCC automatically loads plugin DLLs it finde in the "Plugins" subdirectory of its home. Aside from that auto-loading, only "PLUGIN /L" will cause TCC to try to load a program. That can be done in a TCSTART.BTM and not in a TCMD.INI.

3. TCMD.ini can specify a directory for TCSTART.BTM and TCEXIT.BTM. You can see that specification in TCC's OPTION dialog (Startup tab).
 
#10
Because of bad memory, I forgot about the %_ininame variable. But there's no TITLEPROMPT in there. (I might add that both 32-bit and 64-bit TCC sessions are using the same ini file. I don't see anything in it that should cause a problem, however.) Here's where the TCMD.ini files are:
Code:
[C:\]*Dir TCMD.ini /S /F
C:\Users\Alternative\AppData\Local\JPSoft\TCMD.INI
C:\Users\Daniel Mathews\AppData\Local\JPSoft\TCMD.INI
C:\Users\Daniel Mathews\Application Data\Local\JPSoft\TCMD.INI
C:\Users\Safety Admin Account\AppData\Local\JPSoft\TCMD.INI
I am currently logged on as "Daniel Mathews".

And just to show that the "AppData" and "Application Data" TCMD.ini files have the same contents (they are actually the same file because those two directories are symbolically linked):
Code:
[C:\]FC /B "Users\Daniel Mathews\AppData\Local\JPSoft\TCMD.INI" "users\Daniel Math
ews\Application Data\Local\JPSoft\TCMD.INI"
Comparing files USERS\DANIEL MATHEWS\APPDATA\LOCAL\JPSOFT\TCMD.INI and USERS\DANIE
L MATHEWS\APPLICATION DATA\LOCAL\JPSOFT\TCMD.INI
FC: no differences encountered
And the complete contents of that file:
Code:
[ListView]
Style=1
[TakeCommand]
StatusBar=No
AlwaysOnTop=No
AppendToDir=No
CommandInputFile="Take Command.PID_%PID.txt"
CompleteHiddenFiles=Yes
CompleteHiddenDirs=Yes
CompletePaths=Yes
CompletePercents=Yes
IBeamCursor=No
InactiveTransparency=255
ServerCompletion=Local
SingleInstance=No
Transparency=255
Tray=No
WindowState=Standard
AutoAttachConsoles=No
ConsoleBufferRows=5000
IBeamCaret=No
LeftAltKey=Yes
LeftCtrlKey=Yes
RightAltKey=No
RightCtrlKey=No
SmoothScroll=Yes
SplitterWindows=Yes
StartTabWait=0
TabIcons=Yes
Tabs=Top
TabSize=20
TabRotation=No
TabX=Selected
AutoUpdateFolders=Yes
CloseIfNoTabs=Yes
ClosePrompt=Yes
DescriptionMax=512
Descriptions=Yes
LinuxSelection=No
LockExplorerBar=No
LockMenuBar=Yes
LockTabBar=Yes
MinimizeOnClose=No
MouseWheel=No
NTFSDescriptions=No
PathExt=No
RegularExpressions=Perl
SettingChange=Yes
SHChangeNotify=Yes
ShowHiddenFiles=Yes
ShowSysFiles=Yes
ShowSuperHidden=Yes
SingleClick=No
ShowExtensions=Yes
UpdateTitle=No
WebHelp=No
Wow64FsRedirection=Yes
ZoneId=0
CommandInput=No
[PopupFont]
Font=Lucida Console
Size=-27
Weight=400
Italic=0
Script=0
[Font]
font=Lucida Console
size=-27
weight=400
italic=0
Script=0
[4NT]
ANSI=No
CDDWinLeft=20
CDDWinTop=20
CDDWinWidth=300
CDDWinHeight=140
PopupWinHeight=400
PopupWinTop=19
PopupWinLeft=68
PopupWinWidth=400
WindowHeight=0
WindowState=Standard
WindowWidth=0
WindowX=0
WindowY=0
Transparency=255
InactiveTransparency=255
AmPm=No
BeepFreq=440
BeepLength=2
CommandSep=&
DecimalChar=Auto
DescriptionMax=512
NTFSDescriptions=Yes
Descriptions=Yes
EscapeChar=^
EvalMax=10
EvalMin=0
ExpandPseudovariables=Yes
ParameterChar=$
RegularExpressions=Perl
TabStops=8
ThousandsChar=Auto
ProxyPort=80
FirewallType=None
FirewallPort=1080
PassiveFTP=Yes
FTPTimeout=180
HTTPTimeout=180
TFTPTimeout=180
MailPort=25
RLocalPort=0
SHLocalPort=0
SSHPort=22
SSLStartMode=0
SSLPort=0
AppendToDir=Yes
CompleteHiddenFiles=Yes
CompleteHiddenDirs=Yes
CompletePaths=Yes
CompletePercents=Yes
CursorIns=100
CursorOver=15
DirHistory=6144
DirHistoryOnEntry=No
EditMode=Overstrike
FuzzyCD=0
HistMin=0
History=22528
HistCase=No
HistCopy=No
HistDups=Last
HistMove=Yes
HistWrap=Yes
ServerCompletion=Local
AutoCancel=No
AutoCDD=Yes
AutoRun=Yes
BatchAliases=Yes
BatchEcho=Yes
CMDExtensions=No
CopyPrompt=Yes
DelayedExpansion=No
DelGlobalQuery=Yes
DirJunctions=Yes
DuplicateBugs=Yes
ExecWait=No
HistLogName="C:\Users\Daniel Mathews\AppData\Local\JPSoft\TCHistoryLog"
HistLogOn=Yes
LocalAliases=Yes
LocalDirHistory=Yes
LocalFunctions=Yes
LocalHistory=Yes
LogAll=No
LogName="C:\Users\Daniel Mathews\AppData\Local\JPSoft\TCCommandLog"
LogOn=Yes
LogErrors=Yes
MouseWheel=No
NoClobber=Yes
PathExt=No
Perl=No
Python=No
RecycleBin=No
Rexx=Yes
Ruby=No
SettingChange=Yes
SHChangeNotify=Yes
Tcl=No
TCStartPath=E:\DOS
UnicodeOutput=No
UnixPaths=No
UpdateTitle=Yes
WebHelp=No
Win32SFNSearch=Yes
Wow64FsRedirection=Yes
ZoneId=0
4StartPath=E:\DOS
As you say there's no TITLEPROMPT entry anywhere in it, and, again, I don't remember where I set that up quite a long time ago. There's also no "Plugin" command anywhere in it (although I can't exclude that it's in the same place as is the "TitlePrompt" entry).

Also:
Code:
[C:\]Set /S Ti*
TCC: Not in environment "Ti*"
[C:\]Set /U Ti*
TCC: Not in environment "Ti*"
In fact,
Code:
[C:\]Set /U
JustLoggedOn=Y
TEMP=E:\Temp
TMP=E:\TEMP
and "Set /T" produces output that I think is too long to be included here, but there's nothing interesting in it in my opinion. (I am uploading it here so you can decide for yourself.)

This is not the end of it, however, given that I still don't know where "TitlePrompt" is being set. If you can give me a clue as to where I can find it I would appreciate it. (Obviously I found it at least once!)
 

Attachments

#11
Right! You can't set TITLEPROMPT in the INI file!!!!!

But the INI file does contain:
Code:
TCStartPath=E:\DOS
4StartPath=E:\DOS
That's the specification of where the TCSTART and TCEXIT files are. Did you look there?
 
#12
Well thank you, Vince, it did answer one question but it didn't answer the other. The TCStart.btm file contains:
Code:
@Echo Off
If %_Pipe != 0 .OR. %_Transient != 0 Quit
CDD C:\
CDD E:\
CDD Z:\
Alias /R E:\DOS\Alias.txt
Set _CRLF=^R^N
Call E:\DOS\Functions.btm
Title PID %_PID %@IF[%_X64 == 1,64,32]-bit
If "%TreeExclude" == "" ^
  Set TreeExclude=A:;B:;C:;D:;E:;F:;G:;H:;I:;J:;K:;L:;M:;N:;O:;P:;Q:;R:;S:;T:;U:;V:;W:;X:;Y:;Z:
Iff %@Index[%Path,E:\DOS] == -1 Then
  SetLocal
  Set EDOS=%@Index[%Path,C:\Windows\System32\WindowsPowerShell\v1.0]
  Iff %EDOS == -1 Then
      Set Path=%Path%E:\DOS
  Else
      Set Path=%@Left[%EDOS,%Path]E:\DOS;%@Instr[%EDOS,%Path]
  EndIff
  EndLocal Path
EndIff
I think the compound "If" on the second line pretty much eliminates it as a possibility, don't you?

And it's a "Title" variable rather than "TitlePrompt" variable just for the record. (No I don't know what the difference between the two is and I'm too lazy at the moment to dig it up since it's not a problem.)

So, one ("TitlePrompt") mystery (mostly) solved, the other ("Plugin") still completely open.
 
#13
Well thank you, Vince, it did answer one question but it didn't answer the other. The TCStart.btm file contains:
Code:
@Echo Off
If %_Pipe != 0 .OR. %_Transient != 0 Quit
CDD C:\
CDD E:\
CDD Z:\
Alias /R E:\DOS\Alias.txt
Set _CRLF=^R^N
Call E:\DOS\Functions.btm
Title PID %_PID %@IF[%_X64 == 1,64,32]-bit
If "%TreeExclude" == "" ^
  Set TreeExclude=A:;B:;C:;D:;E:;F:;G:;H:;I:;J:;K:;L:;M:;N:;O:;P:;Q:;R:;S:;T:;U:;V:;W:;X:;Y:;Z:
Iff %@Index[%Path,E:\DOS] == -1 Then
  SetLocal
  Set EDOS=%@Index[%Path,C:\Windows\System32\WindowsPowerShell\v1.0]
  Iff %EDOS == -1 Then
      Set Path=%Path%E:\DOS
  Else
      Set Path=%@Left[%EDOS,%Path]E:\DOS;%@Instr[%EDOS,%Path]
  EndIff
  EndLocal Path
EndIff
I think the compound "If" on the second line pretty much eliminates it as a possibility, don't you?

And it's a "Title" variable rather than "TitlePrompt" variable just for the record. (No I don't know what the difference between the two is and I'm too lazy at the moment to dig it up since it's not a problem.)

So, one ("TitlePrompt") mystery (mostly) solved, the other ("Plugin") still completely open.
TITLE is a command (not a variable); you are explicitly setting the title (once, and I suppose not changing it later).
TITLEPROMPT is a variable; it is evaluated every time TCC issues a prompt and the title is (by implication) set accordingly.

... running out of things to try for the plugin thingy (still betting on a rogue "PLUGIN /L"). Did you look in (a long shot because of the IF you mentioned)
E:\DOS\Functions.btm

Have you got a TCEXIT in e:\dos?
 
#14
I have no further ideas about the plugin message. I doubt your title is relevant. A common way to get _PID into the window caption is with the TITLEPROMPT environment variable. Try SET and see if you see it. Then try SET /U and SET /S. If you see it with SET but not with either SET /U or SET /S, then TITLEPROMPT is likely being set in a TCSTART file. Did you look elsewhere for TCSTART files? They could be anywhere; the path to TCSTAR/TCEXIT is specified in the OPTION dialog (Startup tab). Perhaps you have an old INIfile that specifies an old location for TCSTART/TCEXIT.
_ININAME, _TCSTART and _TCEXIT are your friends here - they return the full path and name of the file actually used as TCMD.INI by the cyrrent instance of TCC, the one that had been used as TCSTART, and the one which will be used as TCEXIT on termination of TCC (caveat: this can changed exiting!).

P.S., That's a mistake I make about once a year ... install a new version in g:\tcN+1 and copy the INIfile, TCSTART.BTM, and TCEXIT.BTM from g:tcN ... then I make changes to the new TCSTART and find thay they don't work because the new INIfile (a copy of the old one) points to the old TCSTART/TCEXIT files.
I avoid this particular issue by using the same TCSTART/TCEXIT files for all versions, but and making parts of the batch file executed only if %_4VER is within an appropriate range.
 
#15
Given the difference(s) between "Title" and "TitlePrompt" I definitely prefer "Title".

Here is the entire contents of "E:\DOS\Functions.btm"
Code:
Function AppName=`%@If[%@Index[%@RawAppName[%1],/] == -1,%@RawAppName[%1],%@Trim[%@Left[%@Index[%@RawAppName[%1],/],%@RawAppName[%1]]]]`
Function BaseFileName=`%@FileName[%@Left[-%@Inc[%@Len[%@Ext[%@If["%@UnQuoteS[%1]" == "",%_BatchName,%@UnQuoteS[%1]]]]],%@If["%@UnQuoteS[%1]" == "",%_BatchName,%@UnQuoteS[%1] ]]]`
Function BatchFileName=`"%@Left[%@Index[%@UnQuoteS[%@FileName[%1]],.,-1],%@UnQuoteS[%@FileName[%1]]]"`
Function Executable=`%@If['%@Trim[%@FType[%@Assoc[.%@Ext[%1]]]]' == '""',%1,%@If["%@Assoc[.%@Ext[%1]]" != "",%@Field[" ",0,%@FType[%@Assoc[.%@Ext[%1]]]],%COMSPEC]]`
Function PctTotal=`%@Format[4.4,%@Eval[100*%@FileSize[%2,b,a]/%@DiskTotal[%1]=1.1]]%%`
Function Link=`%@If["%@SymLink[%1]"=="",%@If["%@Junction[%1]"=="",^^<Not A Junction Or Symbolic Link^^>,%@QuoteS[%@Junction[%1]]],%@QuoteS[%@SymLink[%1]]]`
Function RawAppName=`%@FType[%@Assoc[.%@Ext[%@UnQuoteS[%1]]]]`
Function RemoveParameter=`%@ExecStr[E:\DOS\RemoveParameter %1 %2]`
Function SubDirs=`%@ExecStr[E:\DOS\SubDirs.btm %$]`
Function TrueFileSize=`%@Trim[%@Replace[^,,,%@ExecStr[PDir %1 /(ZCA)]]]`
Function UnOuterQuotes=`%@If['%@Left[1,%1]' == '"' .AND. '%@Right[1,%1]' == '"',%@Left[-1,%@Right[-1,%1]],%1]`
Function VerifyFileNameAndPath=`%@ExecStr[E:\DOS\VerifyFileNameAndPath %1]`
And the only TC<anything> in E:\DOS is TCStart.btm
 
#17
And just to end the %_<filename> question(s):
Code:
[Z:\]Echo Ini: %_IniName  Start: %_TCStart   Exit: %_TCExit
Ini: C:\Users\Daniel Mathews\AppData\Local\JPSoft\TCMD.INI  Start: E:\DOS\TCSTART.btm   Exit:
... run from a 32-bit TCC session.
 
#20
Code:
Volume in drive C is Windows        Serial number is b2cb:b200
Directory of  C:\Program Files (x86)\JPSoft\Plugins\*
 
10/22/2011  11:32          78,336  4console.dll
10/26/2011  21:23          9,049  4console.txt
12/05/2012  20:21        112,640  4utils.dll
12/06/2012  1:22          16,928  4utils.txt
10/22/2011  11:27        112,640  4utils.V2011-10-26.dll
10/26/2011  21:23          15,410  4Utils.v2011-10-26.txt
4/05/2011  17:27          28,160  Chill.dll
10/28/2011  8:51          11,074  chill.html
7/25/2011  10:22          6,027  Fishy Story.txt
4/16/2012  14:14          56,832  Fortune.dll
4/16/2012  14:26          24,091  fortune.html
11/09/2011  20:31          1,532  Hamlet.txt
1/29/2010  11:56          7,564  holidays.ini
6/15/2012  9:41          66,130  iso8601.chm
6/15/2012  9:02          66,048  iso8601.dll
6/15/2012  9:40        119,872  iso8601.html
10/25/2011  15:38          3,521  paranoid.txt
10/10/2011  16:50          38,912  PopInfo.dll
10/28/2011  9:04          10,830  popinfo.html
3/14/2012  10:30          64,973  quotes.txt
2/21/2012  13:45          33,178  SafeChars.chm
2/21/2012  13:43          36,352  safechars.dll
2/21/2012  13:44          39,331  safechars.html
10/02/2009  11:55          1,128  SafeCharsDemo.btm
11/28/2011  7:21          34,304  Say.dll
11/28/2011  16:01          11,039  say.html
2/22/2011  7:59          35,328  snapshot.dll
10/28/2011  10:32          16,816  snapshot.html
10/26/2011  21:20        107,008  sysutils.dll
10/26/2011  21:23          9,120  sysutils.txt
6/04/2012  11:56          1,254  TCExit.btm
7/07/2012  22:22          1,547  TCStart.cun
6/04/2012  9:25          1,482  TCStart.V2012-06-04.btm
6/04/2012  12:47          1,545  TestArchiveHistories.btm
7/25/2011  10:23          17,516  Time Machine.txt
11/14/2011  20:08          1,662  Whose-knee.txt
6/01/2012  13:02          47,104  Words.exe
6/01/2012  13:03          10,577  words.html
5/03/2012  9:55          38,912  Wrap.exe
5/03/2012  9:55          17,464  wrap.html
        1,313,236 bytes in 40 files and 0 dirs    1,400,832 bytes allocated
    51,969,273,856 bytes free
Since "%_TCExit" is a null string, I somehow don't think it's even being executed (although I've attached it in a .zip file if anyone is interested). I also don't see how it could have an effect on anything even if it was being executed.
 

Attachments

#21
Well there's the problem (I mentioned this earlier):
Code:
12/05/2012  20:21        112,640  4utils.dll
10/22/2011  11:27        112,640  4utils.V2011-10-26.dll
TCC is trying to load both of them. In an internal conversation with TCC, they both say "I am 4UTILS".
 
#23
Well thank you! So this is one case where my standard practice for keeping backup versions doesn't work (at least if I keep them in the same directory). But why doesn't it complain when the first one is loaded?
There's nothing to complain about when the first 4UTILS is loaded. But I'd expect you'd see the error message when the original TCC tried to load the second 4UTILS ... you apparently only saw it in pipes. So I figured you had a CLS somewhere at startup (but I didn't see one in your TCSTART). I'll leave that mystery to you. :-)
 
#24
That reply was just mis-worded a bit. I meant (as you replied to) "why didn't the initial TCC report the error?" But it's a mystery that's not important enough for me to waste any time on given that the main issue has been resolved. So thank you, Vince.