Logon Script output log file

  • Thread starter Thread starter Rob P
  • Start date Start date
R

Rob P

I am looking for the equivalant to the following command.
C:\batch.bat >batch.log

But I would like to include it all in a single logon script. I want my log
file to show the commands as well as results.

Thanks.
 
I am looking for the equivalant to the following command.
C:\batch.bat >batch.log

But I would like to include it all in a single logon script. I want my log
file to show the commands as well as results.

Thanks.

c:\batch.bat>>batch.log 2>&1

In the batch, use @echo on instead of @echo off


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Using that from the command prompt gives me exactly what I am looking for
but to run a logon script I want to be able to include this within the logon
script.

I can have one logon script reference another batch file using the syntax
that you provided and it also gives me the output that I am looking for but
I would like to include it all in one logon script.

I have tried using

(
@ECHO ON
COMMAND 1
COMMAND 2
ETC

) > batch.log 2>&1

But it will only output the results. I want to be able to see it with the
command then the result in the log file like it is when entered from the
command prompt.

Thanks,
Rob
 
If your script contains:
@ECHO ON
COMMAND 1
COMMAND 2
ETC

The chage it as follows:

@ECHO ON
call :Logit>>batch.log 2>&1
exit /b 0
:Logit
COMMAND 1
COMMAND 2
ETC


Using that from the command prompt gives me exactly what I am looking for
but to run a logon script I want to be able to include this within the logon
script.

I can have one logon script reference another batch file using the syntax
that you provided and it also gives me the output that I am looking for but
I would like to include it all in one logon script.

I have tried using

(
@ECHO ON
COMMAND 1
COMMAND 2
ETC

) > batch.log 2>&1

But it will only output the results. I want to be able to see it with the
command then the result in the log file like it is when entered from the
command prompt.

Thanks,
Rob


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Use the MTEE command, tip 5921 in the 'Tips & Tricks' at http://www.jsiinc.com

Using that from the command prompt gives me exactly what I am looking for
but to run a logon script I want to be able to include this within the logon
script.

I can have one logon script reference another batch file using the syntax
that you provided and it also gives me the output that I am looking for but
I would like to include it all in one logon script.

I have tried using

(
@ECHO ON
COMMAND 1
COMMAND 2
ETC

) > batch.log 2>&1

But it will only output the results. I want to be able to see it with the
command then the result in the log file like it is when entered from the
command prompt.

Thanks,
Rob


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Thanks! That does exactly what I was looking for.

Rob

Jerold Schulman said:
If your script contains:
@ECHO ON
COMMAND 1
COMMAND 2
ETC

The chage it as follows:

@ECHO ON
call :Logit>>batch.log 2>&1
exit /b 0
:Logit
COMMAND 1
COMMAND 2
ETC


Using that from the command prompt gives me exactly what I am looking for
but to run a logon script I want to be able to include this within the logon
script.

I can have one logon script reference another batch file using the syntax
that you provided and it also gives me the output that I am looking for but
I would like to include it all in one logon script.

I have tried using

(
@ECHO ON
COMMAND 1
COMMAND 2
ETC

) > batch.log 2>&1

But it will only output the results. I want to be able to see it with the
command then the result in the log file like it is when entered from the
command prompt.

Thanks,
Rob


 
Back
Top