UpgradeActionLog.bat 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. @rem
  2. @rem Licensed Materials - Property of IBM
  3. @rem
  4. @rem IBM Cognos Products: fmmd
  5. @rem
  6. @rem (C) Copyright IBM Corp. 2003, 2013
  7. @rem
  8. @rem US Government Users Restricted Rights - Use, duplication or disclosure
  9. @rem restricted by GSA ADP Schedule Contract with IBM Corp.
  10. @rem
  11. @echo off
  12. rem this is a batch file used to upgrade a single log file or all log files under one directory
  13. if "%1" == "" goto ARGEMPTY
  14. if "%1" == "-h" goto HELP
  15. if not exist %1 goto FILENOTEXIST
  16. if not exist %1\nul goto ONEFILE
  17. for %%f in (%1\*.xml) do attrib -r %%f
  18. for %%f in (%1\*.xml) do copy %%f %%f.backup
  19. for %%f in (%1\*.xml) do testXSLT -XD -Q -IN %%f.backup -XSL UpgradeActionLog.xsl -OUT %%f
  20. goto PROMPT
  21. :ONEFILE
  22. copy %1 %1.backup
  23. del /F %1
  24. testXSLT -XD -Q -IN %1.backup -XSL UpgradeActionLog.xsl -OUT %1
  25. goto PROMPT
  26. :ARGEMPTY
  27. echo Usage: %0 [-h] [log_file_path / log_folder_path]
  28. goto THEEND
  29. :HELP
  30. echo Framework Manager Action Log Upgrade Utility
  31. echo Syntax: %0 [-h] log_folder_path / log_folder_path
  32. echo Switches: -h displays this help information
  33. echo Parameters: path to log files or directory only contains log files
  34. echo Examples: %0 myLog.xml or %0 myLogDir
  35. goto THEEND
  36. :FILENOTEXIST
  37. echo %1 doesn't exist, please choose another [log_file_path / log_folder_path]
  38. goto THEEND
  39. :PROMPT
  40. echo sucessfully upgrade log file(s) %1
  41. :THEEND