Page 1 of 1

create a Log everything you did in the batch script

Posted: 09 Aug 2012 12:56
by daillest319
I'm having alot of trouble in getting this to work...orgiinally i was using this on each line...>C:\logfile.txt..... but it there a better way to log everything that was done in the bat script?

Re: create a Log everything you did in the batch script

Posted: 09 Aug 2012 13:00
by foxidrive
This works if the batch doesn't need to get input or display anything.


Code: Select all

batchscript.bat >file.log

Re: create a Log everything you did in the batch script

Posted: 09 Aug 2012 13:12
by daillest319
Thanks works great :) . also is there another way to capture inputs as well?

Re: create a Log everything you did in the batch script

Posted: 09 Aug 2012 13:20
by Squashman
daillest319 wrote:Thanks works great :) . also is there another way to capture inputs as well?


If you are redirecting the batch output to a log file then echo your input variables in your batch file.

set /p myvar=Enter Something:
echo %myvar%