home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / os2 / dfs253s.arj / DFS253S.ZIP / DFSINFO.cmd < prev    next >
Encoding:
Text File  |  1997-12-14  |  4.3 KB  |  132 lines

  1. /* Analyse current status of all physical disks,             JvW 21-01-97    */
  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.  
  11.    Parse Source with . myself .
  12.  
  13.    Parse Arg logname
  14.    if logname = '' then
  15.    do
  16.       logname = 'dfsinfo.txt'
  17.    end
  18.  
  19.    if Address() <> 'DFS' then
  20.    do
  21.       Address cmd '@dfs runq' myself logname
  22.    end; else
  23.    do
  24.       Address cmd '@del' logname
  25.       '@log' logname
  26.  
  27.       say date('E') time()' : Gathering diagnostic information; Please wait ...'
  28.       say ''
  29.       'close'                                   /* release physical disks    */
  30.  
  31.       say date('E') time()' : ' ||,
  32.           'First get the standard available stuff ...'
  33.       'cmd fdisk /query'
  34.  
  35.       'cmd setboot /query'
  36.  
  37.       say date('E') time()' : ' ||,
  38.           "And when available, Doug's partition overview too!"
  39.       'cmd chkpart'
  40.  
  41.       say date('E') time()' : ' ||,
  42.           'Now use our own built-in diagnostic power ...'
  43.  
  44.       'disk 0'
  45.       physdisks  = dfs_number                   /* get number of disks       */
  46.       say 'dfs_number: ' dfs_number
  47.  
  48.       do i=1 to physdisks
  49.          Say ''
  50.          Say 'MBR/EBR chain for disk nr' i
  51.          'walk' i                               /* select next disk and show */
  52.       end                                       /* it's MBR/EBR chain        */
  53.  
  54.       'part +'                                  /* show all partition info   */
  55.       partitions = dfs_number                   /* and remember the count    */
  56.  
  57.       say date('E') time()' : ' ||,
  58.           'dfs_number: ' dfs_number
  59.  
  60.       do i=1 to partitions
  61.          'part' i                               /* select next partition     */
  62.  
  63.          Say ''
  64.          say date('E') time()' : ' ||,
  65.              'Working on partition' i '=' dfs_drive 'on disk' dfs_disknr
  66.          if substr(dfs_drive,2,1)=':' & translate(dfs_drive) == dfs_drive then
  67.          do
  68.             Say ''
  69.             Say 'Running CHKDSK on the partition ...'
  70.             'chkdsk' dfs_drive '< dfsinfo.inp'
  71.  
  72.             Say ''
  73.             Say 'Attempt a normal directory of its root directory'
  74.             'dir' dfs_drive'\'
  75.          end
  76.  
  77.          Say ''
  78.          select
  79.          when substr(dfs_afsys,1,4) = 'HPFS' then
  80.             do
  81.                if translate(dfs_drive) == dfs_drive then
  82.                do
  83.                   Say "Running Doug's HVA if available ..."
  84.                   'hva -e -r -s' dfs_drive'\*'
  85.                end
  86.  
  87.                Say ''
  88.                say date('E') time()':' ||,
  89.                    'Running some DFS HPFS diagnostics ...'
  90.                'check'
  91.                't H'
  92.                ' '
  93.                ' '
  94.                ' '
  95.                '11'
  96.                't H'
  97.                ' '
  98.                ' '
  99.                '0'
  100.                '\'
  101.                ' '
  102.                ' '
  103.                ' '
  104.                '0'
  105.                'f c'
  106.                ' '
  107.                'dirmap'
  108.                'alloc'
  109.             end
  110.          when substr(dfs_afsys,1,3) = 'FAT' then
  111.             do
  112.                say date('E') time()' : ' ||,
  113.                    'Running some DFS FAT diagnostics ...'
  114.                ' '
  115.                if translate(dfs_drive) == dfs_drive then
  116.                do
  117.                   'x'
  118.                   'alloc'
  119.                   'fatshow'
  120.                end
  121.             end
  122.          otherwise
  123.             say date('E') time()' : ' ||,
  124.                 'No specific diagnostics for filesystem' dfs_afsys '(yet).'
  125.             't H'
  126.          end
  127.       end
  128.       say date('E') time()': Gathering diagnostic information finished.'
  129.       '@log'                                    /* close the log file        */
  130.    end
  131. exit 0
  132.