LOG within a batch file

Jun 7, 2008
121
0
Hi

This is with 4NT 8.02.106 under Windows XP SP2, but I believe it is still valid questions for TCC 9.01

1. Could I confirm that SETLOCAL is not supposed to capture the LOG state, such that ENDLOCAL will restore at the end of the batch file the current LOG status? If that is so - it is a bind as I have used quit within the batch file. I have logging just for the duration of the batch file, I wish to turn it back off however the batch file ends.

Any suggestions?

2. If I do LOG /W newfilename how do I revert logging back to the original default filename?

3. I found what I think is a bug with logging.

If I do

LOG /A /W c:\MYLog.txt

then

LOG /A OFF

should turn both error and history logging off, right?
But I have found that history logging is still on.
Admittedly this is with 4NT 8.02

Cheers

Stephen Howe
 

rconn

Administrator
Staff member
May 14, 2008
12,316
148
Stephen Howe wrote:


> This is with 4NT 8.02.106 under Windows XP SP2, but I believe it is
> still valid questions for TCC 9.01
>
> 1. Could I confirm that SETLOCAL is not supposed to capture the LOG
> state, such that ENDLOCAL will restore at the end of the batch file the
> current LOG status? If that is so - it is a bind as I have used quit
> within the batch file. I have logging just for the duration of the batch
> file, I wish to turn it back off however the batch file ends.

SETLOCAL / ENDLOCAL do not affect the state of any of the LOG files.


> Any suggestions?

If it's just one batch file, turn it off before the QUIT. If it's a lot
of batch files, you could do it in your POST_EXEC alias.


> 2. If I do LOG /W newfilename how do I revert logging back to the
> original default filename?

Once you've changed the name, that *is* the default filename. If you
want to restore the original name, you'll have to save it before you
change it.

Rex Conn
JP Software
 
Similar threads
Thread starter Title Forum Replies Date
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
Joe Caverly tcc.exception.log Support 3
rps LOG /a (all) with Atl-F2 Support 2
C Documentation default location for LOG files Support 21
P LOG command behavior Support 3
rps How to? Alias/Command line use of *log on/off Support 2
C b34 Installer leaves LOG in %LocalAppData%\Temp\ Support 1
vefatica Strange tcc.exception.log Support 7
C LOG entry for TCMD/TCC command line Support 15
Jay Sage WAD Issues with LOG Command Support 4
vefatica TCC.LOG Support 4
D How to? How to show variables expanded in the log tab Support 3
M How to? Start a program on log on elevated abovenormal Support 5
F Dating a log Support 14
C TPipe Log file not correct Support 1
A How to? Set up a log file for all command output Support 3
vefatica aemail\datamystic.log? Support 1
M How to? Save the session log from a batch file? Support 5
S Documentation LOG command Support 0
dcantor Documentation Help error for command LOG Support 0
S Log and foldermonitor problems Support 3
V Set path permanently from within TCC? Support 3
cgunhouse Ctrl-C from within a library function Support 6
D What is the limit on the compound statement length within ( ) of a FOR-loop? Support 5
Alpengreis How to? Copy & Paste without linebreak within TCMD Support 13
T 64 bit TCCLE appears to crash when opening tcc.exe from within tcc.exe window Support 7
D Internal variable _tctabs within TCExit Support 9
Exolon Space within path and FOR Support 4
nickles WAD Variable name gets changed within FOR loop Support 2
A How to? Filter a list by numeric number within filename Support 28
M Invoking a DOS command within a C++ program Support 1
thedave Detach from Tab within a BTM? Support 0
vefatica `Back quotes` - command line vs. batch file Support 5
fpefpe How to? batch file size Support 2
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
P Kill all other instances of tcc from a btm batch file Support 2
fpefpe batch file ending early Support 18
R Batch Debugger Command Expansion Window Support 3
K robocopy cancelling batch file processing Support 28
A Unable to pass batch file arguments unaltered Support 18
K Batch debugger not stepping correctly Support 4
S incorrect message at start Cancel batch job 4START.bat ? (Y/N/A) : Support 1
MickeyF Why does this batch file give me 'unknown command "else"' error? Support 17
Joe Caverly "Functions" in cmd.exe batch files Support 6
S Batch files Calling Batch Files Support 2
P exit /b in batch files Support 7
P Labels in batch files: TCC vs CMD.exe Support 9

Similar threads