home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pcboard / pcblogo2.zip / ELIM.DOC < prev    next >
Text File  |  1991-03-20  |  7KB  |  179 lines

  1.                                ELIM 2.0
  2.  
  3.                      Small program to delete files
  4.                        not accessible to DOS Del
  5.                                 - and -
  6.                   Avoid DEL's 'Are you sure?' prompt
  7.                               - and/or -
  8.                        Remove the subdirectory
  9.  
  10.                                   by
  11.  
  12.                                Bob Eyer
  13.                              Mar 20, 1991
  14.  
  15.                 CAUTION: Please read the WARNING below
  16.  
  17.  
  18.      Syntax:
  19.  
  20.      ELIM Filespec [D]
  21.  
  22.      If D is specified on the command line and the  Filespec  indicates
  23.      deletion  of  all  files  in the subdirectory defined by Filespec,
  24.      then ELIM will attempt to remove that subdirectory after all files
  25.      are deleted.  If some  files  (e.g.   read  only)  remain  in  the
  26.      subdirectory,  or  if  it  contains  other  subdirectories, ELIM's
  27.      attempt will not be successful, and will report the status of  the
  28.      attempt at the end of the run, returning a DOS error level of 1.
  29.  
  30.      Discussion:
  31.      ----------
  32.      The  new features of ELIM in version 2.0 have led to a substantial
  33.      alteration of its scope and purpose.  The main purpose of the  new
  34.      ELIM  is to enable deletion of files and directories in which they
  35.      were  formerly  located  with  an  absolute  minimum   number   of
  36.      keystrokes.   ELIM  will  also  handle deletion of files which DOS
  37.      cannot access, but the method by which it does this  is  different
  38.      from the procedure in previous versions.
  39.  
  40.      Formerly, ELIM allowed statements like
  41.  
  42.      ELIM A B
  43.  
  44.      to eliminate or delete a file  with the  invalid  filename  'A B'.
  45.      This  type  of  statement  is no longer supported.  To achieve the
  46.      required effect, the following syntax must be used:
  47.  
  48.      ELIM 'A B'
  49.  
  50.      The  reason  why  this  new syntax is needed is that an additional
  51.      option has been added to the command line, and some means must  be
  52.      provided  to prevent ELIM from interpreting this additional option
  53.      as part of an invalid filename.
  54.  
  55.      ELIM  2.0  always  reports on the screen what it did to each file,
  56.      and will present a count of the number of files deleted,  so  that
  57.      proper  control can be maintained.  Deleted files are displayed in
  58.      'wide' format, so as to make the best use of screen space.
  59.  
  60.      Advantages:
  61.      ----------
  62.      ELIM does not prompt the user for confirmation, where  a  wildcard
  63.      is  used.  Thus, it is unnecessary to pipe a "y" to DEL in a batch
  64.      file.  Just use ELIM.
  65.  
  66.      ELIM supports all DOS wildcard shortcuts.   For  example,  if  one
  67.      wishes  to  delete all the files in the TEST directory, one can do
  68.      that simply by issuing the command
  69.  
  70.      ELIM TEST    (equivalent to 'ELIM TEST\.' and ELIM TEST\*.*'
  71.  
  72.      The following are also legitimate:
  73.  
  74.      ELIM .
  75.      ELIM ..\.
  76.  
  77.      New:
  78.      ---
  79.      ELIM  now takes advantage of DOS's path defaults.  For example, if
  80.      you are in C:\WORK and then transfer to  drive  D:  without  first
  81.      returning  to  the root directory of C:, DOS will remember WORK as
  82.      the default directory of C:.  The new version of ELIM is  designed
  83.      to  detect  the  default  DOS path of other drives.  So, if you've
  84.      left C: in directory WORK and are now on D:,
  85.  
  86.      ELIM C:
  87.  
  88.      will  delete  all  read/write files in C:\WORK and ignore all read
  89.      only files in that directory.  If WORK would be empty  after  file
  90.      deletion, then the following command deletes all the files in WORK
  91.      and then removes the WORK directory itself:
  92.  
  93.      ELIM C: D
  94.  
  95.      Note  the  space  between  'C:'  and  'D'.   'D'  is  a  parameter
  96.      indicating directory deletion, not a drive.
  97.  
  98.      The same trick also applies to subdirectories of the other drive's
  99.      default   path.    For   example,  there  may  have  been  an  ABC
  100.      subdirectory of C:\WORK at the time you left C: for D: and you now
  101.      wish to delete all the files in that subdirectory from D:, as well
  102.      as remove that subdirectory.  This can  be  done  by  issuing  the
  103.      following command:
  104.  
  105.      ELIM C:ABC D
  106.  
  107.      Notice the absence of  the  backslash.   DOS  interprets  commands
  108.      issued  without  the backslash prefix as commanding it to make use
  109.      of DOS default path information.  The command in the example  only
  110.      deletes  the  files  contained  in  C:\WORK\ABC  and  then removes
  111.      C:\WORK\ABC, leaving C:\WORK intact.
  112.  
  113.      NOTE: The following command, with this example, will NOT work:
  114.  
  115.      ELIM C: D
  116.  
  117.      The  obvious purpose here is to remove the WORK directory by using
  118.      DOS's path default.  However, this cannot work, since DOS does not
  119.      permit removing a directory when the user is IN that directory.
  120.  
  121.      If you're in WORK\B and there is an A subdirectory  of  WORK,  you
  122.      can  delete  all  read-write files in the A subdirectory from your
  123.      present B subdirectory by issuing the following command:
  124.  
  125.      ELIM ..\A
  126.  
  127.      You  may  also  have  ELIM  remove  ..\A  after  all files deleted
  128.      automatically.   Provided  ..\A   does   not   itself   have   any
  129.      subdirectories or read only files, this can be done by issuing the
  130.      following command:
  131.  
  132.      ELIM ..\A D
  133.  
  134.  
  135.      Errors:
  136.      ------
  137.      Error responses always return a DOS error level of 1.
  138.  
  139.      If  the  user  specifies  a filename or wildcard to which no files
  140.      correspond, ELIM will return the message "No such file(s)" and  an
  141.      error  level  of 1.  If nothing is mentioned as a parameter on the
  142.      commandline, ELIM will return to the user a small help screen  and
  143.      an error level of 1.
  144.  
  145.      All other ELIM terminations return an error level of 0.
  146.  
  147.      ELIM's  error  level  returns  make  it  possible  to  use ELIM in
  148.      automated batch file programs.
  149.  
  150.      WARNING:
  151.      -------
  152.      Avoid  using ELIM in preference to DOS DEL, unless you really know
  153.      what you are doing.  The designers of DOS deliberately put in  the
  154.      'Are  you  sure?' prompt on the DEL command for a reason, and that
  155.      reason is that it's better to be safe than sorry.
  156.  
  157.      Because ELIM focusses  on  minimising  keystrokes  and  on  taking
  158.      advantage  of  DOS's  natural  defaults as much as possible, it is
  159.      very easy to use ELIM in such a way as to do a lot of damage  that
  160.      you  may  not intend.  DO NOT USE THIS PROGRAM ON REAL CASES UNTIL
  161.      AFTER YOU'VE RUN IT EXPERIMENTALLY ON A  DOZEN  EXAMPLES  SUCH  AS
  162.      THOSE INDICATED ABOVE.
  163.  
  164.      DISCLAIMER:
  165.      ==========
  166.      This program is circulated as public domain without any  guarantee
  167.      or  warranty;  and  the  user, by downloading this program, or any
  168.      variant thereof or by receiving it or any of its versions  in  any
  169.      other  form, agrees to accept full responsibility for its use.  It
  170.      is therefore understood that the user accepts this program or  any
  171.      previous  version  as  is.
  172.  
  173.      Bob Eyer                  The author may also be reached at
  174.      Compuserve [73230,2620]   ROSE MEDIA 416-733-2285 (Main Conf)
  175.      Toronto                   or
  176.      Canada                    CANADA REMOTE 416-629-7044 (IBM Conf)
  177.      -------------------------------------------------------------
  178.      End of documentation.
  179.