1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

LOG within a batch file

Discussion in 'Support' started by Stephen Howe, Sep 11, 2008.

  1. Stephen Howe

    Joined:
    Jun 7, 2008
    Messages:
    121
    Likes Received:
    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
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,854
    Likes Received:
    83
    Stephen Howe wrote:


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


    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.


    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
     

Share This Page