_logfile Issue

Dec 2, 2008
224
2
Canada
I was noticing some strange things happening with my _logfile. I have TCMD setup to log as follows:

Logs.png

I setup two TCC processes, in first I ran:

do forever (echo ------ >>%_logfile)
The first process had a PID of 19700

Yes, this TCC process is constantly feeding the logfile.

The second TCC, I ran:

echo "%@Filelock[%_logfile]"

and I would run this over and over manually and some of the results were:

"4 19700" strange, system process (PID: 4) and the first TCC (PID: 19700)
"19700" this one is okay
"4" system process
"" No process has a lock on it.​

where did the "4 " come from? I think it is the SYSTEM process which is PID 4, but "4 19700" would mean that two processes having a lock on the same file? @Filelock is also sending back two process ids, the documentation does not indicate it should be doing this.

Occasionally I would also get:

TCC: (Sys) The parameter is incorrect.
"C:\JPSoft\Logs\Commands.txt"

I got the above error when the first TCC process lost connection to the file attached to _logfile. After killing the "DO" loop on the first TCC process, If I typed :

echo %_logfile

you would get:

ECHO is off

instead of the file name attached to _logfile. I don't know why the connection was broken.
 
Dec 2, 2008
224
2
Canada
echo ^n---- <.BTM Filename> <Process Id> ----^n >>%_logfile

To tell me what has just started and it's pid so when I open the _logfile to look at it, I don't have dig around for the information.
 
Last edited:
May 29, 2008
571
4
Groton, CT
echo ^n---- <.BTM Filename> <Process Id> ----^n >>%_logfile

To tell me what has just started and it's pid so when I open the _logfile to look at it, I don't have dig around for the information.

I have something like this
Code:
echo Running (%_batch) %_batchname at %_date  %_time

That will go into the log file, of course, and also display it. If you don't want to display it on the screen, add
Code:
> nul
to it, or use the LOG verb instead of ECHO.

Code:
LOG Running (%_batch) %_batchname at %_date  %_time

The PID shows up in the log file entry. Here's an example:
Code:
[03-21-16 12:59:04][8140] echo Running (1) C:\Users\DCantor\Work\taskwatch1.bat at 21-Mar-2016 12:59:04 EDT
 
Dec 2, 2008
224
2
Canada
LOG would probably do what I want, using the redirect ">" and ">>" is just a habit.

LOG ^n^n---- <.BTM Filename> <Process Id> ----^n
 
Similar threads
Thread starter Title Forum Replies Date
G v28 Display Issue Support 7
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
fpefpe How to? issue with % and evaluation Support 5
cgunhouse Standard User Account Issue Support 2
samintz WAD Display wrapping issue Support 5
M TCC color issue in ConEmu Support 4
samintz Timer issue Support 4
Alpengreis Documentation Minor issue in help file for view /E Support 1
samintz WAD ANSI issue Support 3
D TCSTART issue after reinstallation Support 14
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
Chen Touboul Overtyping issue - i press the Insert key, help till press enter for new line in TCC Support 2
Y TCC and Cmder imcompatibility issue Support 7
M Another possibly strange remote registry issue Support 5
T WAD bpokestr issue Support 5
D High-DPI Scaling issue Support 1
S CMDebug 22 issue with del command Support 1
cgunhouse Foldermonitor Issue Support 7
samintz Build 38 Install issue Support 5
rps WAD Setlocal issue Support 4
Luiz Rodrigues Issue with Maven Support 1
Seven Update / install issue with 20.0.20.10.32 take command Support 7
Fross WebDav Drive Mapping Issue Support 19
D Upgrade issue Support 3
Fross V20b8 Everything Issue Support 5
T TCC display issue Support 1
T Fixed Querybox issue Support 1
cgunhouse Fixed Share Memory Issue Support 5
cgunhouse Foldermonitor with "/E" Option Issue Support 6
Fross TabComplete Argument Issue Support 1
fpefpe How to? Stange start up issue Support 1
C cosmetic issue with LIST's (I) Support 9
jbarnes1967 TC 18.00 x64 issue with lua io.popen() Support 2
D How to? Wildcards as sets - looping issue with FOR and REN Support 7
T WAD Free issue Support 6
R Fixed v17.0.54 Tab->COMSPEC Dialog Box Issue Support 2
R Minor Cosmetic Issue in Take Command Window Support 2
cgunhouse One line IFF ... Then ... Else ... EndIFF Statement issue in V17 Support 13
cgunhouse IFTP Path Issue in V17 - Fixed Support 7
S BDEBUGGER issue Support 9
cgunhouse @ISPROC Issue Support 15
cgunhouse TCMD.INI Issue Support 7
T Fixed multi-line alias issue Support 13
R WAD issue with filename completion with system and hidden files Support 8
D Strange issue with FOR loop Support 15
C Install Issue with 3rd Party Privelege Escalation Support 2
W Button command issue Support 5
S XenForo issue Support 8
nikbackm Fixed v15: Issue with @select Support 3

Similar threads