[comp.os.msdos.misc] Question on batch files

usagi@jhunix.hcf.jhu.edu (Erin Sasaki) (02/04/91)

Hello --

	I have a Dell System 310 running MS-DOS 4.0, and I have a quick
question.  I am interested in being able to delete entire directories
within a batch file - without having to type:

	del file1
	del file2 ... etc.

	So - I was going to use the command del *.* in the batch file.
However, I would like to disable the MS-DOS verify (in this case only).
Is there a quick way to do this?  

	Thanks for your time.


			-- Erin Sasaki
			   usagi@jhunix.hcf.jhu.edu

usagi@jhunix.hcf.jhu.edu (Erin Sasaki) (02/10/91)

	Thanks to everyone who answered my posting.  If anyone else
is interested, the most common answer to my question was to either use
the command:

	echo y | del *.*

or to create a file called "yes.cr" or something similar with the 
character 'y' and a carriage return and redirect it into the del *.*.
Both methods work great!

		-- Erin Sasaki
		   usagi@jhunix.hcf.jhu.edu

cs422122@umbc5.umbc.edu (cs422122) (02/10/91)

In article <7471@jhunix.HCF.JHU.EDU> usagi@jhunix.hcf.jhu.edu (Erin Sasaki) writes:
>Hello --
>
>	I have a Dell System 310 running MS-DOS 4.0, and I have a quick
>question.  I am interested in being able to delete entire directories
>within a batch file - without having to type:
>
>	del file1
>	del file2 ... etc.
>
>	So - I was going to use the command del *.* in the batch file.
>However, I would like to disable the MS-DOS verify (in this case only).
>Is there a quick way to do this?  
>
>	Thanks for your time.
>
>
>			-- Erin Sasaki
>			   usagi@jhunix.hcf.jhu.edu


echo y | del *.*    (BE CAREFUL!  This automatically answers Y to the
                     "Are you sure?" prompt.)
















###############################################################################
#  Mike Reese  #  Mail:  mzr@detrick-hsc.army.mil  #  "Make it so!"           #
#  US Army     #  Phone: (301)663-2081             #       --Jean Luc Picard  #
###############################################################################

jglover@ducvax.auburn.edu (02/11/91)

In article <7471@jhunix.HCF.JHU.EDU>, usagi@jhunix.hcf.jhu.edu (Erin Sasaki) writes> Hello --
> > 	So - I was going to use the command del *.* in the batch file.
> However, I would like to disable the MS-DOS verify (in this case only).
> Is there a quick way to do this?  
> 

Sure is, pipe in your input from a text file, such as;
                                                           
         del subdir\*.* < yes   ( or c:\dos\yes, best to use a full path)
            
where the file 'yes' is an ascii file containing a single character 'y'.

I use this method all the time, no trouble.  

Jay G. - Auburn U.
-------------------

vandevek@fergvax.unl.edu (James M. VandeVegt) (02/11/91)

In article <4984@umbc3.UMBC.EDU> cs422122@umbc5.umbc.edu.UUCP (cs422122) writes:
>In article <7471@jhunix.HCF.JHU.EDU> usagi@jhunix.hcf.jhu.edu (Erin Sasaki) writes:
>>Hello --
>>	I have a Dell System 310 running MS-DOS 4.0, and I have a quick
>>question.  I am interested in being able to delete entire directories
>>within a batch file - without having to type:
>>
>>	del file1
>>	del file2 ... etc.
>>
>>	So - I was going to use the command del *.* in the batch file.
>>However, I would like to disable the MS-DOS verify (in this case only).
>>Is there a quick way to do this?  
>>			-- Erin Sasaki
>>			   usagi@jhunix.hcf.jhu.edu
>
>echo y | del *.*    (BE CAREFUL!  This automatically answers Y to the
>                     "Are you sure?" prompt.)
>
Alternately, in batch mode:
   for %%a in (*.*) do del %a
In interactive processing:
   for %a in (*.*) do del %a

same warning applies, this WILL DELETE every file in the directory.
>
>###############################################################################
>#  Mike Reese  #  Mail:  mzr@detrick-hsc.army.mil  #  "Make it so!"           #
>#  US Army     #  Phone: (301)663-2081             #       --Jean Luc Picard  #
>###############################################################################


| James M. VandeVegt             |  University of Nebraska           |
| vandevek@fergvax.unl.edu       |  Computer Science and Engineering |
----------------------------------------------------------------------
|                  Insert standard disclaimer here.                  |

dmckeon@hydra.unm.edu (Denis McKeon) (02/15/91)

cd subdir
echo y | del *.*

    works well, but:

echo y | del subdir

    seems to work faster on big directories.
    (although perhaps it will not work under dos <= 2.x)

--
Denis
dmckeon@hydra.unm.edu