Today I played a little bit with LOG.
I want to achieve that the output of my script is stored in a file without echoing + redirection.
It seems that I can do it with "LOG /A".
But I'm not sure if LOG is completely working correct.
Here is an example (log-test.btm):
And this is the output:
I want to achieve that the output of my script is stored in a file without echoing + redirection.
It seems that I can do it with "LOG /A".
But I'm not sure if LOG is completely working correct.
Here is an example (log-test.btm):
Code:
@echo off
ver
echo.
log off
log /e off
log /a off
log /w tcc.log
echo hello world
echoerr hello error
do makes no sense
log off
log /a /w tcc_all.log
echo hello world
echoerr hello error
do makes no sense
log /a off
log /e /w tcc_errors.log
echo hello world
echoerr hello error
do makes no sense
log /e off
dir tcc*.log
for %log in (tcc*.log) ( echo ^n%log -------------- %+ type /L %log )
Code:
(system) C:\...\TCMD14x64 >log-test.btm
TCC 14.03.52 x64 Windows 7 [Version 6.1.7601]
Deleting C:\Program Files\JPSoft\TCMD14x64\tcc.log
Deleting C:\Program Files\JPSoft\TCMD14x64\tcc_all.log
2 files deleted
hello world
hello error
C:\Program Files\JPSoft\TCMD14x64\log-test.btm [13] Usage : DO [n | FOREVER]
hello world
hello error
C:\Program Files\JPSoft\TCMD14x64\log-test.btm [19] Usage : DO [n | FOREVER]
hello world
hello error
C:\Program Files\JPSoft\TCMD14x64\log-test.btm [25] Usage : DO [n | FOREVER]
Volume in drive C is system Serial number is 54b7:f82e
Directory of C:\Program Files\JPSoft\TCMD14x64\tcc*.log
07.01.2013 19:26 225 tcc.log
07.01.2013 19:26 105 tcc_all.log
330 bytes in 2 files and 0 dirs 8.192 bytes allocated
3.499.761.664 bytes free
tcc.log --------------
1 : [07.01.13 19:26:58][4936] echo hello world
2 : [07.01.13 19:26:58][4936] echoerr hello error
3 : [07.01.13 19:26:58][4936] do makes no sense
4 : [07.01.13 19:26:58][4936] log off
5 : [07.01.13 19:26:58][4936] Usage : DO [n | FOREVER]
6 :
tcc_all.log --------------
1 : hello world
2 : hello error
3 : C:\Program Files\JPSoft\TCMD14x64\log-test.btm [19] Usage : DO [n | FOREVER]
- No error log is created. Why?
- In tcc.log: should it contain line 5 at all?
- In tcc_all.log: is it correct that /A doesn't include command logging?
I would like this because that is what I need in this case ;-)