Guest User

log.cmd

a guest
Sep 22nd, 2011
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rem @echo off
  2.  
  3. if "%1" == "" goto error
  4. if "%1" == "sec" goto sec
  5. if "%1" == "pro" goto pro
  6. if "%1" == "nl" goto nl
  7. if "%1" == "nl2" goto nl2
  8. goto error
  9.  
  10. :sec
  11. rem Add section title
  12. if "%2" == "" goto error
  13. set "title=%2"
  14.  
  15. setlocal
  16. set "frame=%title% ============================================================="
  17. echo.%frame:~60%>> log.txt
  18. echo.=%title%=>> log.txt
  19. echo.%frame:~60%>> log.txt
  20. endlocal
  21. echo. >> log.txt
  22. goto end
  23.  
  24. :pro
  25. rem Add program title
  26. if %2 == "" goto error
  27. set "title=%2"
  28.  
  29. setlocal
  30. set "frame=%title% ============================================================="
  31. echo.%frame:~60%>> log.txt
  32. echo.=%title%=>> log.txt
  33. echo.%frame:~60%>> log.txt
  34. endlocal
  35. echo. >> log.txt
  36. goto end
  37.  
  38. :nl
  39. rem New Line
  40. echo. >> log.txt
  41. goto end
  42.  
  43. :nl2
  44. rem New Line x2
  45. echo. >> log.txt
  46. echo. >> log.txt
  47. goto end
  48.  
  49.  
  50. :error
  51. echo. >> log.txt
  52. echo bad log.cmd usage >> log.txt
  53. :end
Advertisement
Add Comment
Please, Sign In to add comment