Logon Script output log file

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.
 
J

Jerold Schulman

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
 
R

Rob P

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
 
J

Jerold Schulman

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
 
J

Jerold Schulman

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
 
R

Rob P

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


 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Log of a batch file... 5
Calling webpage with logon script, logon script wont close 16
Logon script ? 2
DSQuery 0
Script for Change the Proxy Setting 3
Can't run Batch file 3
Executing system calls 3
Pause a script 1

Top