home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 29 Fixes_o / 29-Fixes_o.zip / warpfix.zip / CMPD.CMD < prev    next >
OS/2 REXX Batch file  |  1994-07-28  |  4KB  |  130 lines

  1. @echo off
  2. setlocal
  3. rem CMPD.CMD for CM/2 1.11.
  4. rem Executables used by this command file:
  5. rem saveram2.exe,   file compression
  6. rem copyini.exe,    copy locked files
  7. rem qsystem.exe     query system hardware
  8.  
  9. if "%1"=="" goto :help
  10.  
  11. if not %cmpath%=="" goto cm11
  12. set %cmpath%="\cmlib"
  13. :cm11
  14. set Dest=%CMPath%\cmpd
  15. set Log=%Dest%\cmpd.log
  16.  
  17. if not "%2"=="" goto FFSTSpecified
  18. set EPW=C:
  19. :FFSTSpecified
  20. set EPW=%2
  21. set EPW=%EPW%\os2
  22.  
  23. set LAPS=%3
  24. if not "%LAPS%"=="" goto :LAPSset
  25. set LAPS=%CMPath%\..
  26. :LAPSset
  27. set LAPS=%LAPS%\ibmcom
  28.  
  29. if not exist %EPW%\system goto ParameterError
  30. if not exist %cmpath% goto ParameterError
  31.  
  32. echo Creating %CMPath%\%1.ram
  33. mkdir %Dest% >nul 2>>&1
  34.  
  35. rem Copy the locked files: system error logs
  36. copyini %EPW%\system\log0001.dat %Dest%\log0001.dat >%Log% 2>>&1
  37. copyini %EPW%\system\log0001.bak %Dest%\log0001.bak >>%Log% 2>>&1
  38.  
  39. rem Save process environment, APPC information, HW config,and cmkernel info.
  40. pstat >%Dest%\pstat.txt 2>>&1
  41. display >%Dest%\display.txt 2>>&1
  42. qsystem -D >%Dest%\qsystem.txt 2>>&1
  43. cmquery >%Dest%\cmquery.txt 2>>&1
  44. copy %EPW%\config.sys %Dest% >>%Log% 2>>&1
  45. copy %EPW%\startup.cmd %Dest% >>%Log% 2>>&1
  46. copy c:\config.sys %Dest% >>%Log% 2>>&1
  47. copy c:\startup.cmd %Dest% >>%Log% 2>>&1
  48. syslevel >%Dest%\syslvl.txt 2>>&1
  49.  
  50. rem Delete the old CMPD output file, we only want one copy
  51. del %CMPath%\%1.ram >>%Log% 2>>&1
  52.  
  53. rem Copy CM dump & trace files by PMR number.
  54. cmtrace copy %dest%\%1.trc /o  >>%Log% 2>>&1
  55. if ERRORLEVEL 1 goto NotActive
  56. cmtrace stop >nul 2>>&1
  57. :NotActive
  58. rem cmtrace stop >nul 2>>&1
  59. rem cmtrace copy %dest%\%1.trc /o  >nul 2>>&1
  60. copy %CMPath%\%1*.* %Dest% >>%Log% 2>>&1
  61.  
  62. rem Copy non-locked FFST/2 logs.
  63. copy %EPW%\system\os2mlog.dat  %Dest% >>%Log% 2>>&1
  64. copy %EPW%\system\epw\os2mlog.dat  %Dest%\os2mlog2.dat >>%Log% 2>>&1
  65. copy %EPW%\system\*.dmp %Dest% >>%Log% 2>>&1
  66. copy %EPW%\system\epw\*.dmp %Dest% >>%Log% 2>>&1
  67. copy %CMPath%\*.log %Dest% >>%Log% 2>>&1
  68.  
  69. rem Display a list of ISDN adapter dumps. These are very large.
  70. rem They are rarely created so we just want to know if any exist.
  71. dir c:\i*.dmp >>%Dest%\idmp.dir 2>>&1
  72. dir \i*.dmp >>%Dest%\idmp.dir 2>>&1
  73. dir %EPW%\..\i*.dmp >>%Dest%\idmp.dir 2>>&1
  74.  
  75. rem Look in all alternate locations for cm.log and cmrinst.log.
  76. copy %EPW%\cmlib\cm.log %Dest%  >>%Log% 2>>&1
  77. copy c:\cm.log %Dest%  >>%Log% 2>>&1
  78. copy %EPW%\install\cmrinst.log %Dest%  >>%Log% 2>>&1
  79. copy %cmpath%\cm2apar.log %Dest% >>%Log% 2>>&1
  80.  
  81. rem Copy CM/2 config files.
  82. copy %cmpath%\cm.ini %Dest% >>%Log% 2>>&1
  83. copy %CMPath%\*.rsp %Dest% >>%Log% 2>>&1
  84. copy %CMPath%\*.cfg %Dest% >>%Log% 2>>&1
  85. copy %CMPath%\*.cf2 %Dest% >>%Log% 2>>&1
  86. copy %CMPath%\*.ndf %Dest% >>%Log% 2>>&1
  87. copy %CMPath%\*.sec %Dest% >>%Log% 2>>&1
  88. copy %CMPath%\network.ini %Dest% >>%Log% 2>>&1
  89. copy %CMPath%\net_00.sup %Dest% >>%Log% 2>>&1
  90. copy %CMPath%\*.cxm %Dest% >>%Log% 2>>&1
  91. copy %CMPath%\cml2*.* %Dest% >>%Log% 2>>&1
  92.  
  93. rem Copy LAPS information if applicable.
  94. copy %LAPS%\protocol.ini %Dest% >>%Log% 2>>&1
  95. copy %LAPS%\lantran.log %Dest% >>%Log% 2>>&1
  96.  
  97. echo Compressing:
  98. dir /w %Dest%\*
  99.  
  100. rem Compress all those files.
  101. saveram2  /Qt %Dest%\*.* %CMPath%\%1.ram
  102.  
  103. rem Clean up
  104. echo Y | del %Dest%\* >>nul 2>>&1
  105. rmdir %Dest% >>nul 2>>&1
  106. if exist %Dest% goto EraseError
  107. goto end
  108.  
  109. :ParameterError
  110. echo CMPD has determined that the parameters passed do not correctly indicate the
  111. echo location of files to be collected. Verify the location of CMLIB, FFST
  112. echo error logs, and review the command syntax.
  113. echo -
  114.  
  115. :help
  116. echo %0 PMRnumber ╒FFST/2 Drive■ ╒LAPS Drive■
  117. echo e.g. %0 5X123456 c: d:
  118. echo The parameter ╒FFST/2 Drive■ refers to the drive where FFST/2 is
  119. echo configured to store its error logs. This is usually the boot drive.
  120. echo Any unsaved trace data will be saved in: PMRNumber.trc
  121. goto end
  122.  
  123. :EraseError
  124. echo The CMPD temporary files could not be erased. You may erase
  125. echo %Dest%\* to save disk space once the files are no longer locked.
  126. goto end
  127.  
  128. :end
  129. endlocal
  130.