home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1999 November / PCOnline_11_1999.iso / filesbbs / OS2 / DFSEE305.ZIP / DFSINFO.cmd < prev    next >
OS/2 REXX Batch file  |  1999-02-22  |  5KB  |  160 lines

  1. /* Analyse current status of all physical disks,             JvW 22-02-99    */
  2. /* partition tables and partition format information                         */
  3. /* Then, for all HPFS partitions, show basic information                     */
  4. /* and find the Root-directory and Codepage info without                     */
  5. /* using the superblock or spareblock pointers                               */
  6. /* All results will be contained in the logfile DFSINFO.TXT                  */
  7. /*                                                                           */
  8. /* JvW 22-11-97 Updated for sync with DFS 2.50 (dfs_number)                  */
  9. /* JvW 14-12-97 Updated for sync with DFS 2.53 (FAT stuff)                   */
  10. /* JvW 19-04-98 Updated more... and added first NTFS stuff; minor fixes      */
  11. /* JvW 22-02-98 Updated 'dir' discarding DIRCMD; added 'part ++' and 'map'   */
  12.  
  13.    Parse Source with . myself .
  14.  
  15.    Parse Arg logname
  16.    if logname = '' then
  17.    do
  18.       logname = 'dfsinfo.txt'
  19.    end
  20.  
  21.    if Address() <> 'DFS' then
  22.    do
  23.       Address cmd '@dfs runq' myself logname
  24.    end; else
  25.    do
  26.       Address cmd '@del' logname
  27.       '@log' logname
  28.       'more 0'                                  /* prevent more... pausing   */
  29.  
  30.       say date('E') time()' : Gathering diagnostic information; Please wait ...'
  31.       say ''
  32.       'close'                                   /* release physical disks    */
  33.  
  34.       say date('E') time()' : ' ||,
  35.           'First get the standard available stuff ...'
  36.       'cmd fdisk /query'
  37.  
  38.       'cmd setboot /query'
  39.  
  40.       say date('E') time()' : ' ||,
  41.           "And when available, Doug's partition overview too!"
  42.       'cmd chkpart'
  43.  
  44.       say date('E') time()' : ' ||,
  45.           'Now use our own built-in diagnostic power ...'
  46.  
  47.       'part'
  48.       'map'
  49.       'part $*'
  50.       'disk 0'
  51.       physdisks  = dfs_number                   /* get number of disks       */
  52.       say 'dfs_number: ' dfs_number
  53.  
  54.       do i=1 to physdisks
  55.          Say ''
  56.          Say 'MBR/EBR chain for disk nr' i
  57.          'walk' i                               /* select next disk and show */
  58.       end                                       /* it's MBR/EBR chain        */
  59.  
  60.       'part ++'                                 /* show max partition info   */
  61.       partitions = dfs_number                   /* and remember the count    */
  62.  
  63.       say date('E') time()' : ' ||,
  64.           'dfs_number: ' dfs_number
  65.  
  66.       do i=1 to partitions
  67.          'part' i                               /* select next partition     */
  68.  
  69.          Say ''
  70.          say date('E') time()' : ' ||,
  71.              'Working on partition' i '=' dfs_drive 'on disk' dfs_disknr
  72.          if substr(dfs_drive,2,1)=':' & translate(dfs_drive) == dfs_drive then
  73.          do
  74.             Say ''
  75.             Say 'Running CHKDSK on the partition ...'
  76.             'chkdsk' dfs_drive '< dfsinfo.inp'
  77.  
  78.             Say ''
  79.             Say 'Attempt a normal directory of its root directory'
  80.             'set  dircmd='                      /* discard DIRCMD like /P    */
  81.             'dir' dfs_drive'\'
  82.          end
  83.  
  84.          Say ''
  85.          select
  86.          when substr(dfs_afsys,1,4) = 'HPFS' then
  87.             do
  88.                if translate(dfs_drive) == dfs_drive then
  89.                do
  90.                   Say "Running Doug's HVA if available ..."
  91.                   'hva -e -r -s' dfs_drive'\*'
  92.                end
  93.  
  94.                Say ''
  95.                say date('E') time()' : ' ||,
  96.                    'Running some DFS HPFS diagnostics ...'
  97.                'check'
  98.                '0'
  99.                't H'
  100.                ' '
  101.                ' '
  102.                ' '
  103.                '11'
  104.                't H'
  105.                ' '
  106.                ' '
  107.                '0'
  108.                '\'
  109.                ' '
  110.                ' '
  111.                ' '
  112.                '0'
  113.                'f c'
  114.                ' '
  115.                'dirmap'
  116.                'alloc'
  117.             end
  118.          when substr(dfs_afsys,1,4) = 'NTFS' then
  119.             do
  120.                say date('E') time()' : ' ||,
  121.                    'Running some DFS NTFS diagnostics ...'
  122.                ' '
  123.                if translate(dfs_drive) == dfs_drive then
  124.                do
  125.                   '0'
  126.                   ' '
  127.                   ' '
  128.                   ' '
  129.                   ' '
  130.                   ' '
  131.                   ' '
  132.                   ' '
  133.                   ' '
  134.                   ' '
  135.                   ' '
  136.                end
  137.             end
  138.          when substr(dfs_afsys,1,3) = 'FAT' then
  139.             do
  140.                say date('E') time()' : ' ||,
  141.                    'Running some DFS FAT diagnostics ...'
  142.                ' '
  143.                if translate(dfs_drive) == dfs_drive then
  144.                do
  145.                   'x'
  146.                   'alloc'
  147.                   'fatshow'
  148.                end
  149.             end
  150.          otherwise
  151.             say date('E') time()' : ' ||,
  152.                 'No specific diagnostics for filesystem' dfs_afsys '(yet).'
  153.             't H'
  154.          end
  155.       end
  156.       say date('E') time()': Gathering diagnostic information finished.'
  157.       '@log'                                    /* close the log file        */
  158.    end
  159. exit 0
  160.