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???
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?
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"
Summary: I have been trying to write a batch file for our enterprise. First in order to open anything with admin as a user you obviously use the runas from right clicking on the icon or whatever the case is. ...
Summary: You realize the string "MyBat.bat" on my last post was just an example, don't you? You should replace it by the filename of your own batch file. Perhaps that's what's going wrong? -- Leonardo Pignatar...