LOG within a batch file

Jun 7, 2008
121
0
#1
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
10,742
97
#2
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