Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Logging bat files, how?

14 Dec 2010   #1

Windows 7 Professional 32 bit
Logging bat files, how?

Hey guys

I want to log the outcome/what happens when I run a .bat file in startup.

How do I do it?

Am not interested in pausing it, just create a log file.

// Chris

My System SpecsSystem Spec

14 Dec 2010   #2

Win 8 RP, Win 7, XP

you could put some 'echo' lines in the .bat file before/after important steps/choices like:
echo "important event 1"
echo "important event 2"
and run the .bat file with redirecting output to a log file:
NameOf.bat >file.log
My System SpecsSystem Spec
14 Dec 2010   #3

Windows 7 Ultimate x86

Just as a small pointer:
NameOf.bat > file.log would overwrite that log with every run. If you want a log over a longer period you just need to use 2 "chevrons":
NameOf.bat >> file.log

My System SpecsSystem Spec

14 Dec 2010   #4

Windows 7 Professional 32 bit

Ok, cool! Thanks a lot guys! That certainly does help
My System SpecsSystem Spec
14 Dec 2010   #5


You can even use the chevron / double chevron trick inside the batchfile eg:-

echo "Start Test" >testlog.txt
do test
echo "Test Complete" >>testlog.txt
My System SpecsSystem Spec

 Logging bat files, how?

Thread Tools

Similar help and support threads for2: Logging bat files, how?
Thread Forum
system hangs after logging off and logging back! Performance & Maintenance
Logging on General Discussion
Solved logging off General Discussion
Logging in bug? Chillout Room
BSOD dmp files without logging in. BSOD Help and Support
When logging in to windows 7 all my files are missing General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 04:45 PM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33