[comp.sys.ibm.pc.programmer] DOS Batch Programming < 4DOS

mckeonj@ul.ie (JOHN MCKEON: STYX RBBS-PC LIMERICK) (07/06/90)

In article <1990Jun24.043414.24256@caen.engin.umich.edu>, mrice@caen.engin.umich.edu (Michael Rice) writes:
> Hi.  I would like to know if the following can be done?
> I have a batch file that does a DEL subdirectory
> where subdirectory is some temporary directory.  The problem is
> DOS asks the question about "All files will be deleted Are you
> sure? "
If you were running under 4DOS, you would use the alias KD,
which deletes all the files in the specified subdirectory
without prompting, then removes the specified directory.
$DOS has many many delightful features and is to be recommended
to serious programmers. One of these features is that most of
your batch files can be collated into one single batch file
called ALIASES.BAT (think of the saving on overheads) which
defines or redefines commands. 
$DOS is a replacement for COMMAND.COM, compatible with versions
of DOS from 2.00 upwards, obtainable from SIMTEL.
DOS commands are enhanced, and new ones added; for example:
DEL (& ERASE) have switches added:
DEL/P prompts for confirmation for each file to be deleted
DEL/Q suppresses filename echoing during deletion
DEL/Y suppresses all prompting, even for *.*

You would have one line in ALIASES.BAT as follows:

alias kd `del/y %1\*.*^rd %1`

Then if you enter >kd c:\scratch
it all happens. Magic!
-------------------------------------------------------------------
"Eppuor si muove!" (Galileo Galilei)
-------------------------------------------------------------------
John McKeon, Material Science Dept. University of Limerick, Ireland
also Sysop of STYX RBBS Limerick +353-61-332229  FidoNet 2:253/171