Computing.Net > Forums > Disk Operating System > log to file batch file execution???

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

log to file batch file execution???

Reply to Message Icon

Name: David
Date: March 23, 2000 at 13:18:04 Pacific
Comment:

Does dos have a command to print the exection results of a batch file to a log file?



Sponsored Link
Ads by Google

Response Number 1
Name: Mr obscurity
Date: March 26, 2000 at 12:19:11 Pacific
Reply:

you could pipe the output of all the commands in the batch file.

ie copy filename destination > logfile.txt

or you could use the error codes for all dos programs to determine the success of the operations. eg the errorlevel return by dos commands for a successful run is 0.


0

Response Number 2
Name: RamFan
Date: February 5, 2001 at 19:36:41 Pacific
Reply:

The only problem with using errorlevel exit codes is that not all dos commands return an errorlevel after execution. Batch files are Well "Batch Files" and they can do an unlimited number of tasks with an unlimited number of results. if your batch file is long and runs several tasks then
1) open up your batch file and find the line(s) you want to redirect the results from.
2) add ">filename" to the end of the command.
3)if you want to append the results to "filename" without overwriting the data each time the batch file is run, use ">>filename"

If your just trying to debug the batch file. use "command /y /c batfile.bat"



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: log to file batch file execution???

where can i get a program to make batch files into exe's.please help www.computing.net/answers/dos/where-can-i-get-a-program-to-make-batch-files-into-exesplease-help/2096.html

Trying to yse Batch files as runas www.computing.net/answers/dos/trying-to-yse-batch-files-as-runas/17015.html

Log of a batch file www.computing.net/answers/dos/log-of-a-batch-file/13244.html