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
chs4326

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
boyans

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
SledgeDG

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

-DG
My System SpecsSystem Spec
.


14 Dec 2010   #4
chs4326

Windows 7 Professional 32 bit
 
 

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

win7
 
 

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
Reply

 Logging bat files, how?




Thread Tools





Similar help and support threads
Thread Forum
system hangs after logging off and logging back!
hi! I logged off and logged back in.My system displays a black screen and doesn't log back in.It freezes and doesn't log back in. Help would be appreciated. mahesh
Performance & Maintenance
Logging on
I have a HP TouchSmart computer, had it about 2/3 months, personalized it as I wanted it, all was fine, now when I log on each morning it goes back to the original 'factory' settings, and says I am a 'logging in on temporary profile' I then have to go back to the 11th Sept in System Restore...
General Discussion
BSOD dmp files without logging in.
Ok so I read the sticky and I know the instructions for posting about BSOD crashes. Sorry if I am violating strict rules but I need some help. The BSOD screen is preventing me from logging in. It actually appears as windows tries to log on. I also tried safemode and that was a no go. So I can't...
BSOD Help and Support
Logging off of WHS from Win 7?
Searched with no results, high and low and google...get too much cross reference. Should be a simple fix... Help is appreciated. New install of Windows 7 here, new user. I connected to my WHS HP mediasmart server files, and got annoyed at my password login information popping up more...
Network & Sharing
When logging in to windows 7 all my files are missing
Please help me!!! I have installed windows 7 32 bit and yesterday everything was fine i set all my shortcuts to the tab and copied all my files from my external hardrive. I set up my email account and installed a few programs aswel and everything seemed perfect but when i logged on this morning all...
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 02:32.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App