home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / batch / sw_43.zip / DI-13.DOC next >
Text File  |  1992-07-11  |  9KB  |  233 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                             
  10.                        ┌────────────────────────────┐  
  11.                        │                            │░░
  12.                        │           DI.EXE           │░░
  13.                        │      Disk Information      │░░
  14.                        │                            │░░
  15.                        │           ▄▀▀▀▀▄           │░░
  16.                        │           █    █           │░░
  17.                        │            ▀▀▀▀            │░░
  18.                        │            ┌──┐            │░░
  19.                        │   Ver 1.3  │  │  (c) 1992  │░░
  20.                        │            │  │            │░░
  21.                        │            └──┘            │░░
  22.                        └────────────────────────────┘░░
  23.                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                  July 11, 1992
  59.  
  60.                                  INTRODUCTION
  61.  
  62.      The  SW package  contains  the  companion  program, DI.EXE.  This  little
  63. utility will be indispensable for those batch files that require the  informa-
  64. tion about a disk or drive.  If you've ever had your  nice SW screen messed up
  65. with DOS error messages, you'll love DI!
  66.  
  67.      The program puts  all the little disk checking  functions in one easy  to
  68. use package. With it you  can check the validity of a drive letter input  from
  69. the user, drive status,  disk status, and identify  the current drive. You can
  70. even access  the Volume label on  a disk to  verify that the user  has put the
  71. proper disk in the drive. Volume labels can be changed too. You  can even make
  72. sure there's enough space for copying files or check the PATH for a file.
  73.  
  74.     SYNTAX: DI [drive:] /switch [label | filespec | size | varname] [/CD]
  75.  
  76.      The  first parameter  indicates the  drive on  which the operation  is to
  77. take  place. If it is left out, the default drive will  be used. These are the
  78. switches:
  79.  
  80.      /VALID - Check drive to verify its existence.
  81.      /READY - Check drive to see if a disk is present.
  82.      /WRITE - Check disk write-protect status.
  83.      /ID - Return current drive #. A=1, B=2, etc.
  84.      /SPACE - Check disk for available space.
  85.      /SIZE - Check disk size. Returns EL code.
  86.      /EXIST - Check PATH for a file. /CD to change to location.
  87.      /FIND - Locate file on drive. /CD to change to location.
  88.      /MATCH_VOL - Check for proper Volume ID.
  89.      /NEW_VOL - Change Volume ID.
  90.      /DEL_VOL - Delete Volume ID.
  91.      /GET_VOL - Get Volume ID. Returned to environment.
  92.  
  93.      The third  parameter is  used  with the  /SPACE, /EXIST,  /FIND, /ID  and
  94. Volume ID switches.
  95.  
  96. /VALID  /READY  /WRITE 
  97.      These  switches check the state  of the drive. /VALID merely verifies the
  98.      existance  of  the device.  /READY  determines  if  a  formatted disk  is
  99.      present. /WRITE checks the write protection  status. All of these  return
  100.      an EL  0 (Errorlevel  0) if true and  an EL 1 if  not. Additionally, they
  101.      will return an EL 2 if a bad or unformatted disk is present.
  102.  
  103. /ID 
  104.      This  switch  identifies  the  current  drive.  The  Errorlevel  returned
  105.      corresponds to the drive number where A=1, B=2, etc. You  can then set an
  106.      environment variable  to be used to return  to that drive at any point in
  107.      your batch file. If you  use DOS 3.3 or higher, DI  /ID can save  you the
  108.      trouble  by returning  the drive  letter directly  into  the environment.
  109.      Just add the variable  name (8 letters max) you want the letter  assigned
  110.      to after  the switch. Only  the letter is  returned so be  sure to use  a
  111.      colon after it in the batch file (e.g. %DRV%:). 
  112.  
  113.  
  114.  
  115.  
  116.                                       1
  117.  
  118. /SPACE
  119.      Two methods can be used to check available space. You can either  provide
  120.      a filespec such as  "c:\temp\*.exe" or the number  of KBytes in  the form
  121.      "/1024". If a filespec is provided, DI will  count the number a bytes  in
  122.      the files matching it,  calculate the clusters that will be used by  each
  123.      file, and then  check the drive  for available space. NOTE:  If providing
  124.      only  a path without a filename, end it with a \. c:\temp\ is the same as
  125.      c:\temp\*.*. Without  the \,  DI will check  c:\ for a  file named  temp.
  126.      /SPACE will work on  drives up to  4,000 MB  capacity. Returns EL 0  when
  127.      there enough  space. CAUTION: DI  does not take  into account files  with
  128.      the same name on the destination drive.
  129.  
  130. /SIZE 
  131.      This  allows you  to verify  that the  proper formatted  floppy is  in  a
  132.      drive.  This switch  returns an  EL code  based on  standard floppy  disk
  133.      formats. EL 1 - No disk,  EL 2 - bad or unformatted disk, EL 3 less  than
  134.      180 K, EL 5 - 180K, EL 6 - 360K, EL 7 - 720K, EL 8 - 1.2M,  EL 9 - 1.44M,
  135.      EL 10 - 2.88M, EL 11 greater than 2.88M. With this information you  could
  136.      then issue the proper FORMAT command.  Obviously, this switch cannot tell
  137.      you the size of a disk  that has not been formatted  and it will not tell
  138.      you how much space is actually available. Use /SPACE for that.
  139.  
  140. /EXIST 
  141.      This  expands the  batch file  function  "if  exist". This  function will
  142.      search  the PATH for the filename specified in  the third parameter. This
  143.      will  be useful  if your batch file  needs to know the  capabilities of a
  144.      unfamiliar machine. The drive parameter is not used.  Users of DOS 3.3 or
  145.      better have an  additional feature. Add  a variable name (8  letters max)
  146.      after the filename  and DI will return the  exact location of the file in
  147.      the DOS  environment in  the  form d:\dir.  If  you  want the  drive  and
  148.      directory  information separate, specify two variables separated  by a \.
  149.      e.g. "DI /EXIST XCOPY.EXE d\dir" will return "D=C" and "DIR=\DOS" in  the
  150.      environment. Returns EL 0 if successful.
  151.  
  152. /FIND
  153.      This switch will locate the FIRST occurrence of  a file on the  specified
  154.      drive.  The environment  variable options  described for /EXIST  apply to
  155.      /FIND as well. Both  /FIND and /EXIST also have the additional option  of
  156.      changing to  the drive and  directory where the  file was  found. Add /CD
  157.      after the filename to make the change.
  158.  
  159. /MATCH_VOL  /NEW_VOL  /DEL_VOL  /GET_VOL
  160.      For the Volume ID functions /MATCH_VOL  and /NEW_VOL, the third parameter
  161.      is the  label to match or  the new label respectively.  No label name  is
  162.      required for /DEL_VOL or  /GET_VOL. You can  provide a variable name  for
  163.      /GET_VOL to  use as the third  parameter. Although label  checking is not
  164.      case-sensitive, labels  written to the drive  will be  all caps. /GET_VOL
  165.      will return the answer in the environment using  the drive letter as  the
  166.      variable  if  no  other  variable name  is  provided.  Returns  EL  0  if
  167.      successful.
  168.  
  169.      Most of these DI  functions return EL 0  if the operation was successful,
  170. EL 1 if not  and EL 2 if the  disk in the drive  is unformatted or  bad. While
  171. debugging  your batch files, you can add  a /D as a last  parameter to display
  172. the code  returned. Otherwise,  there is  no screen output  from this  utility
  173.  
  174.                                       2
  175.  
  176. except  when it receives a bad  parameter or none  at all. A short description
  177. of the program and the switches  is displayed in that case.  If you pass a bad
  178. parameter, DI will return Errorlevel 255.
  179.  
  180.      DI switches can  be shortened to 3 characters  if you prefer. /EXIST  can
  181. be /EXI,  /SPACE can be  /SPA, etc. The longer forms just  make the batch file
  182. more readable.
  183.  
  184.      NOTE:  Any DI  switch that  uses  the  environment to  return information
  185. requires that you use DOS 3.3 or higher.
  186.  
  187.  ═══════════════════════════════════════════════════════════════════════════
  188.  
  189.      DI.EXE is part of the SW  shareware package. Registration information can
  190. be found at the end of the SW.EXE documentation. 
  191.  
  192. DI Ver. 1.3  July 11, 1992
  193.  
  194. Warren Small                              CIS  71076,407
  195. 35 Benjamin Street                        GEnie  W.SMALL
  196. Manchester, NH  03109                     Prodigy  RSJW31A
  197.  
  198.  
  199.                                 DI.EXE History
  200.  
  201.      1.0 - 12/1/91  Initial Release.
  202.  
  203.      1.1 - 2/2/92   New /ID  switch for DI.EXE  to return  current drive.  DOS
  204. environment  can be  used with  /ID and  /EXIST to  return info.  DI  switches
  205. /READY and /WRITE enhanced to show bad or unformatted disks.
  206.  
  207.      1.2 - 2/29/92  Added  /FIND switch to locate first  occurrence of a file.
  208. /EXIST switch enhanced with  /CD switch to change  to the drive  and directory
  209. where the file was found. /FIND also has /CD option.
  210.  
  211.      1.2a  - 3/2/92   Fixed  bug in  /EXIST  and  /FIND which  caused improper
  212. operation if file was located in the root directory and /CD was specified.
  213.  
  214.      1.3 - 7/11/92   /EXIST and /FIND enhanced  to return drive  and directory
  215. in  separate variables.  Added /SIZE  to get  diskette size,  /GET_VOL to read
  216. volume label and return in environment.
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.                                       3
  233.