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