create a Log everything you did in the batch script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
daillest319
Posts: 27
Joined: 31 Jan 2012 14:45

create a Log everything you did in the batch script

#1 Post by daillest319 » 09 Aug 2012 12:56

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?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

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

#2 Post by foxidrive » 09 Aug 2012 13:00

This works if the batch doesn't need to get input or display anything.


Code: Select all

batchscript.bat >file.log

daillest319
Posts: 27
Joined: 31 Jan 2012 14:45

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

#3 Post by daillest319 » 09 Aug 2012 13:12

Thanks works great :) . also is there another way to capture inputs as well?

Squashman
Expert
Posts: 4471
Joined: 23 Dec 2011 13:59

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

#4 Post by Squashman » 09 Aug 2012 13:20

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%

Post Reply