conv_compat.cmd 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. @rem Licensed Materials - Property of IBM
  2. @rem IBM Cognos Products: cclcore
  3. @rem (C) Copyright IBM Corp. 2005, 2010
  4. @rem US Government Users Restricted Rights - Use, duplication or disclosure restricted
  5. @rem by GSA ADP Schedule Contract with IBM Corp.
  6. @echo off
  7. for /F "usebackq tokens=*" %%A in (`dir icucogdt36l\cnvalias.icu /B/S`) do (
  8. set cur_name=%%A
  9. set cur_size=%%~zA
  10. )
  11. for /F "usebackq tokens=*" %%A in (`dir icucogdt36l\cnvalias_compat.icu /B/S`) do (
  12. set compat_name=%%A
  13. set compat_size=%%~zA
  14. )
  15. for /F "usebackq tokens=*" %%A in (`dir icucogdt36l\cnvalias_original.icu /B/S`) do (
  16. set orig_name=%%A
  17. set orig_size=%%~zA
  18. )
  19. set status=0
  20. if not {%1}=={} (goto :param)
  21. if %cur_size%==%compat_size% (
  22. echo CRN Compatibility mode is ON
  23. set status=1
  24. )
  25. if %cur_size%==%orig_size% (
  26. echo CRN Compatibility mode is OFF
  27. set status=0
  28. )
  29. goto :end
  30. :param
  31. set er1=Invalid parameter: %1
  32. set er2=Invalid parameter value: %2
  33. set h1=Usage: "conv_compat.cmd [-CRN_Compatibility=<on|off>]"
  34. set h2=Turns on or off Cognos ReportNet compatibility mode.
  35. if /i not %1==-CRN_Compatibility (
  36. echo %er1%
  37. echo %h1%
  38. echo %h2%
  39. set status=2
  40. )
  41. if /i not %2==off (
  42. if /i not %2==on (
  43. echo %er2%
  44. echo %h1%
  45. echo %h2%
  46. set status=2
  47. )
  48. )
  49. if %status%==2 (
  50. goto :end
  51. )
  52. if /i %2==on (
  53. if %cur_size%==%orig_size% (
  54. copy /y %compat_name% %cur_name%
  55. if %errorlevel%==0 (
  56. echo CRN Compatibility mode is switched to ON
  57. set status=1
  58. ) else (
  59. echo An unexpected error occured, please contact Cognos custommer support.
  60. set status=2
  61. )
  62. ) else (
  63. echo CRN Compatibility mode is ON
  64. set status=1
  65. )
  66. )
  67. if /i %2==off (
  68. if %cur_size%==%compat_size% (
  69. copy /y %orig_name% %cur_name%
  70. if %errorlevel%==0 (
  71. echo echo CRN Compatibility mode is switched to OFF
  72. set status=0
  73. ) else (
  74. echo An unexpected error occured, please contact Cognos custommer support.
  75. set status=2
  76. )
  77. ) else (
  78. echo CRN Compatibility mode is OFF
  79. set status=0
  80. )
  81. )
  82. :end
  83. exit /b %status%