Dec 282017
 
Delete files DOS can not. For example, blanks and graphic characters inserted in the filename, etc.
File ELIM21.ZIP from The Programmer’s Corner in
Category File Managers
Delete files DOS can not. For example, blanks and graphic characters inserted in the filename, etc.
File Name File Size Zip Size Zip Type
ELIM.DOC 7631 2956 deflated
ELIM.EXE 7104 4575 deflated

Download File ELIM21.ZIP Here

Contents of the ELIM.DOC file


ELIM 2.1

Small program to delete files
not accessible to DOS Del
- and -
Avoid DEL's 'Are you sure?' prompt
- and/or -
Remove the subdirectory

by

Bob Eyer
Mar 21, 1991

CAUTION: Please read the WARNING below

Syntax:

ELIM Filespec [D]

If D is specified on the command line and the Filespec indicates
deletion of all files in the subdirectory defined by Filespec,
then ELIM will attempt to remove that subdirectory after all files
are deleted. If some files (e.g. read only) remain in the
subdirectory, or if it contains other subdirectories, ELIM's
attempt will not be successful, and will report the status of the
attempt at the end of the run, returning a DOS error level of 1.

Discussion:
----------
The new features of ELIM in version 2.1 have led to a substantial
alteration of its scope and purpose. The main purpose of the new
ELIM is to enable deletion of files and directories in which they
were formerly located with an absolute minimum number of
keystrokes. ELIM will also handle deletion of files which DOS
cannot access, but the method by which it does this is different
from the procedure in previous versions.

Formerly, ELIM allowed statements like

ELIM A B

to eliminate or delete a file with the invalid filename 'A B'.
This type of statement is no longer supported. To achieve the
required effect, the following syntax must be used:

ELIM 'A B'

The reason why this new syntax is needed is that an additional
option has been added to the command line, and some means must be
provided to prevent ELIM from interpreting this additional option
as part of an invalid filename.

ELIM 2.1 always reports on the screen what it did to each file,
and will present a count of the number of files deleted, so that
proper control can be maintained. Deleted files are displayed in
'wide' format, so as to make the best use of screen space.

Advantages:
----------
ELIM does not prompt the user for confirmation, where a wildcard
is used. Thus, it is unnecessary to pipe a "y" to DEL in a batch
file. Just use ELIM.

ELIM supports all DOS wildcard shortcuts. For example, if one
wishes to delete all the files in the TEST directory, one can do
that simply by issuing the command

ELIM TEST (equivalent to 'ELIM TEST\.' and ELIM TEST\*.*'

The following are also legitimate:

ELIM .
ELIM ..\.

New:
---
ELIM now takes advantage of DOS's path defaults. For example, if
you are in C:\WORK and then transfer to drive D: without first
returning to the root directory of C:, DOS will remember WORK as
the default directory of C:. The new version of ELIM is designed
to detect the default DOS path of other drives. So, if you've
left C: in directory WORK and are now on D:,

ELIM C:

will delete all read/write files in C:\WORK and ignore all read
only files in that directory.

The same trick also applies to subdirectories of the other drive's
default path. For example, there may have been an ABC
subdirectory of C:\WORK at the time you left C: for D: and you now
wish to delete all the files in that subdirectory from D:, as well
as remove that subdirectory. This can be done by issuing the
following command:

ELIM C:ABC D

Notice the absence of the backslash. DOS interprets commands
issued without the backslash prefix as commanding it to make use
of DOS default path information. The command in the example only
deletes the files contained in C:\WORK\ABC and then removes
C:\WORK\ABC, leaving C:\WORK intact.

NOTE: The following command, with this example, will NOT work:

ELIM C: D

The obvious purpose here is to remove the WORK directory by using
DOS's path default. However, this cannot work, since DOS does not
permit removing a directory when the user is IN that directory.

If you're in WORK\B and there is an A subdirectory of WORK, you
can delete all read-write files in the A subdirectory from your
present B subdirectory by issuing the following command:

ELIM ..\A

You may also have ELIM remove ..\A after all files deleted
automatically. Provided ..\A does not itself have any
subdirectories or read only files, this can be done by issuing the
following command:

ELIM ..\A D


Errors:
------
Error responses always return a DOS error level of 1.

If the user specifies a filename or wildcard to which no files
correspond, ELIM will return the message "No such file(s)" and an
error level of 1. If nothing is mentioned as a parameter on the
commandline, ELIM will return to the user a small help screen and
an error level of 1.

ELIM will accommodate a maximum of 32 undeleted files; if you have
a directory containing more than 32 read only files (or hidden or
system), ELIM 2.1 will automatically stop making a record of the
excess beyond 32, will note this situation at termination,
returning an error level of 1. In these circumstances, however,
ELIM will nonetheless delete all read-write files in such a
directory, no matter how large it is.

All other ELIM terminations return an error level of 0.

ELIM's error level returns make it possible to use ELIM in
automated batch file programs.

WARNING:
-------
Avoid using ELIM in preference to DOS DEL, unless you really know
what you are doing. The designers of DOS deliberately put in the
'Are you sure?' prompt on the DEL command for a reason, and that
reason is that it's better to be safe than sorry.

Because ELIM focusses on minimising keystrokes and on taking
advantage of DOS's natural defaults as much as possible, it is
very easy to use ELIM in such a way as to do a lot of damage that
you may not intend. DO NOT USE THIS PROGRAM ON REAL CASES UNTIL
AFTER YOU'VE RUN IT EXPERIMENTALLY ON A DOZEN EXAMPLES SUCH AS
THOSE INDICATED ABOVE.

DISCLAIMER:
==========
This program is circulated as public domain without any guarantee
or warranty; and the user, by downloading this program, or any
variant thereof or by receiving it or any of its versions in any
other form, agrees to accept full responsibility for its use. It
is therefore understood that the user accepts this program or any
previous version as is.

Bob Eyer The author may also be reached at
Compuserve [73230,2620] ROSE MEDIA 416-733-2285 (Main Conf)
Toronto or
Canada CANADA REMOTE 416-629-7044 (IBM Conf)
-------------------------------------------------------------
End of documentation.


 December 28, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)