home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / dfsee510.zip / dfsunfd.cmd < prev    next >
OS/2 REXX Batch file  |  2003-01-14  |  6KB  |  197 lines

  1. @echo off
  2. rem 10-01-2003 JvW Fixed GEO/ALL parameter passing to native script      (5.10)
  3. echo.
  4. echo Get DFSee UNFDISK information
  5.  
  6. if "%0"=="UNFDTEST"     echo on
  7. if "%0"=="unfdtest"     echo on
  8.  
  9. if "%OS%"==""        goto notnt
  10. if "%OS%"=="DOS"     goto notnt
  11. if "%OS%"=="MSDOS"   goto notnt
  12. if "%OS%"=="DRDOS"   goto notnt
  13. if "%OS%"=="IBMDOS"  goto notnt
  14. :dfsnt
  15. set dfsexe=dfswin.exe
  16. goto dfsee
  17. :notnt
  18. if "%OS2_SHELL%"=="" goto notos2
  19. :dfsnt
  20. set dfsexe=dfsos2.exe
  21. goto dfsee
  22. :notos2
  23. set dfsexe=dfsdos.exe
  24. :dfsee
  25. if exist dfsunfdi.sk1 del  dfsunfdi.sk1
  26. if exist dfsunfdi.sk2 del  dfsunfdi.sk2
  27. if exist dfsunfdi.sk3 del  dfsunfdi.sk3
  28. if exist dfsunfdi.sk4 del  dfsunfdi.sk4
  29. if exist dfsunfdi.sk5 del  dfsunfdi.sk5
  30. if exist dfsunfdi.sk6 del  dfsunfdi.sk6
  31. if exist dfsunfdi.sk7 del  dfsunfdi.sk7
  32. if exist dfsunfdi.sk8 del  dfsunfdi.sk8
  33. if exist dfsunfdi.sk9 del  dfsunfdi.sk9
  34.  
  35. if "%1" == "" echo (to get help on other usage just type:  '%0  ?')
  36. echo.
  37. if "%1" == "?"   goto usage
  38. if "%1" == "/?"  goto usage
  39. if "%1" == "-?"  goto usage
  40.  
  41. %dfsexe% -b -q query RValid
  42. if not errorlevel 1 goto work
  43. echo.
  44. echo NOTE: Your DFSee version is not properly registred, this will cause
  45. echo       some extra delays and reminder messages to be displayed  ...
  46. echo.
  47.  
  48. :work
  49. if "%2" == "*"   goto allsect
  50. if "%2" == "a"   goto allsect
  51. if "%2" == "A"   goto allsect
  52. if "%2" == "All" goto allsect
  53. if "%2" == "ALL" goto allsect
  54. if "%2" == "all" goto allsect
  55. if "%2" == ""    goto cbfast
  56. if "%1" == "*" echo WARNING: specified geometry '%2' is ignored with disks *
  57.  
  58. :cbfast
  59. echo Searching partition information on cylinder boundaries only. (fast)
  60. set scmd=cyl
  61. goto scmdset
  62. :allsect
  63. echo Searching partition information in ALL sectors (takes a long time!)
  64. set scmd=all
  65. :scmdset
  66.  
  67. set runcmd=-RO -Quit -batch -quiet -7bit run -Error:ignore dfsunfd.dfs
  68.  
  69. if "%1" == ""                     goto alldisks
  70. if "%1" == "*"                    goto alldisks
  71. if "%scmd%" == "all"  goto doallgeo
  72. set geo=%2 %3 %4
  73. goto dodisk
  74. :doallgeo
  75. set geo=%3 %4 %5
  76. :dodisk
  77. %dfsexe% -l:dfsunfdi.sk%1 %runcmd% %1 %scmd% %geo%
  78. goto showerrors
  79.  
  80. :alldisks
  81. echo Detecting number of physical disks using %dfsexe% :
  82. %dfsexe% -b -t- -e- query Disks
  83. if errorlevel 50 echo goto badquery
  84. if errorlevel 10 echo Only the first 9 disks will be collected ...
  85. if errorlevel  9 goto disk9
  86. if errorlevel  8 goto disk8
  87. if errorlevel  7 goto disk7
  88. if errorlevel  6 goto disk6
  89. if errorlevel  5 goto disk5
  90. if errorlevel  4 goto disk4
  91. if errorlevel  3 goto disk3
  92. if errorlevel  2 goto disk2
  93. if errorlevel  1 goto disk1
  94. goto disk0
  95.  
  96. :badquery
  97. echo The number of disks is unbelievable, information will not be collected
  98. echo Diagnostic information will be in 'dfsunfdi.sk0'
  99. echo.
  100. %dfsexe% -R -b -l:dfsunfdi.sk0 query Disks
  101. goto end
  102.  
  103. :disk9
  104. %dfsexe% -l:dfsunfdi.sk9 %runcmd% 9 %scmd%
  105. :disk8
  106. %dfsexe% -l:dfsunfdi.sk8 %runcmd% 8 %scmd%
  107. :disk7
  108. %dfsexe% -l:dfsunfdi.sk7 %runcmd% 7 %scmd%
  109. :disk6
  110. %dfsexe% -l:dfsunfdi.sk6 %runcmd% 6 %scmd%
  111. :disk5
  112. %dfsexe% -l:dfsunfdi.sk5 %runcmd% 5 %scmd%
  113. :disk4
  114. %dfsexe% -l:dfsunfdi.sk4 %runcmd% 4 %scmd%
  115. :disk3
  116. %dfsexe% -l:dfsunfdi.sk3 %runcmd% 3 %scmd%
  117. :disk2
  118. %dfsexe% -l:dfsunfdi.sk2 %runcmd% 2 %scmd%
  119. :disk1
  120. %dfsexe% -l:dfsunfdi.sk1 %runcmd% 1 %scmd%
  121.  
  122. :showerrors
  123. if errorlevel 235 goto failure
  124. if errorlevel 234 goto noscript
  125. if errorlevel 001 goto failure
  126. goto showdir
  127.  
  128. :noscript
  129. echo.
  130. echo ERROR: The required DFSee script 'DFSUNFD.DFS' was not found.
  131. echo Check if it is in the current directory, the same directory
  132. echo as the execuatable %dfsexe% or a directory on the PATH
  133. goto showdir
  134.  
  135. :failure
  136. echo.
  137. echo WARNING: Execution of the DFSUNFD script seems to have failed.
  138. echo This could be the result of unexpected disk geometry or
  139. echo other strange behaviour of disk-drivers, BIOS and so on
  140. echo.
  141. echo Also check if %dfsexe% and the script file DFSUNFD.DFS can be
  142. echo found in the current directory, or a directory on the PATH.
  143.  
  144. :showdir
  145. echo.
  146. echo Resulting DFSee info logfiles:
  147. dir dfsunfdi.*
  148. echo.
  149. echo email these file(s) to support@dfsee.com for analysis (ZIP if possible)
  150. echo Include as many details about the disk partitions as you remember.
  151. echo.
  152. goto end
  153.  
  154. :baddisk
  155. echo.
  156. echo Disk number %1 does not seem to be present (or locked)
  157. :locked
  158. echo A disk in your system is not accesible, possibly locked.
  159. echo This might be caused by another FDISK, LVM or DFSee program being active.
  160. echo Please close all other FDISK related programs before running %0
  161. echo.
  162. goto end
  163.  
  164. :disk0
  165. echo No physical disks detected ...
  166. echo.
  167. goto end
  168.  
  169. :usage
  170. echo A careful analysis of the generated info can lead to a series of %dfsexe%
  171. echo commands like NEWMBR and CREATE to re-create missing/lost partitions.
  172. echo.
  173. echo Usage: %0 [* or Disk-nr [* or All or Cyl] [? or #cyl [#head [#sect]]]]
  174. echo.
  175. echo Default is search all disk on cylinder boundaries only (fast mode)
  176. echo.
  177. echo    * or Disk-nr   =  search specified disk(s), 1 .. 9  or * = all disks
  178. echo.
  179. echo         Cyl       =  search on cylinder boundaries only (fast, default)
  180. echo    * or All       =  search all sectors, this will find any sector
  181. echo                      but can be real slow. (like 8 hours for 40Gb disk)
  182. echo.
  183. echo    ? or #cyl      =  Number of cylinders value  1..65535 or ? = calculate
  184. echo         #head     =  Number of heads     value  1..255
  185. echo         #sect     =  Number of sectors   value  1..63
  186. echo                      #head and #sect use defaults when not specified.
  187. echo                      When a '?' is used for #cyl, it will be calculated
  188. echo                      based on the known disk-size, #head and #sect
  189. echo Examples:
  190. echo    %0                     all disks, use standard geometry
  191. echo    %0 * *                 all disks, every sector (slow, every geometry)
  192. echo    %0 3                   disk 3 only, use standard geometry
  193. echo    %0 1 1000 64 32        disk 1, geo: 1000 cyls, 64 heads, 32 sects
  194. echo    %0 2 ? 240 63          disk 2, geo: 240 heads, 63 sects, #cyl calculated
  195. echo    %0 2 All ? 240 63      disk 2, same as above, but search ALL sectors
  196. :end
  197.