Technical Forums (Troubleshooting)

This will provide you easy trouble shooting.

Thursday, October 6, 2011

How to Create System Log Using Batch Script

Several time we need to trace our log to check which types of error and waring exist in our computer system there is a easy way to generate system log.you  don't need any software installation.So copy this script and paste in notepad and give name like log.bat in your Operating System drive (like C: drive or whatever you want).
Script:
  1. @echo off
  2. echo. > l1.txt
  3. echo Log File >> l1.txt
  4. echo. >> l1.txt
  5. echo User : %username%  >> l1.txt
  6. Date />>l1.txt
  7. Time />> l1.txt
  8. echo. >> l1.txt
  9. echo Process Ran by %username% >> l1.txt
  10. echo. >> l1.txt
  11. qprocess  >> l1.txt
  12. echo. >> l1.txt
  13. echo Network Activities  >> l1.txt
  14. netstat ->> l1.txt
  15. exit

And here is another part of this application which is an HTML code to show you log in Browser.just Copy and paste this code in notepad and save as log.html .
Code :
  1. <!-- Author : Mohammad Usman
  2.     Date   : 12/07/2011    -->
  3. <head><title>Log File - Usman</title></head>
  4. <br/>
  5. <center><h1><u> Log File </u></h1>
  6. <i>This Log file is created by <b>Usman</b> for monitoring System Activities!</i>
  7. <br/>
  8. <ul>
  9. <center><a href="c:/l1.txt">Click here to view the Log File</a></center>
  10. </ul>
  11. </body>
  12. </html>

Thanks.

No comments:

Post a Comment