🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #376

Re: Need DOS batch help!

#376
From: Stig Venaas
Date: Thu, 13 Aug 1992 09:55
53 lines
1907 bytes
In article <1992Aug12.141526.25165@athena.mit.edu> chanh@athena.mit.edu (Chanh N. Vuong) writes:
>In article <92225.09262732BFPQ3@CMUVM.CSV.CMICH.EDU> Nathan Owen <32BFPQ3@CMUVM.CSV.CMICH.EDU> writes:
>>I having a problem writing a batch file.  I need a batch file which will go
>>to a c:\Temp directory and delete every file in the directory except for
>>a file named gest.bat.  The batch must be written in such a way they the
>>user will not get a message asking Yes/No (Y/N) in response to deleting
>>the files , which limits your use of wildcard deletes like del *.*.
>>
>>Thanx in advance.
>
>Here goes:
>
>DEL_TEMP.BAT:
>@echo off
>c:
>cd \
>cd temp
>md tmp
>copy gest.bat tmp
>for %%a in (*.*) do del %%a
>copy c:\temp\tmp\gest.bat .
>del c:\temp\tmp\gest.bat
>rd tmp
>cd \
>
>*The End*
>
>	+------------------------------------------------------+
>	|  |\/\/\/|       Chanh N. Vuong (aka Cee Vee)         |
>	|  |      |       chanh@athena.mit.edu                 | 
>	|  | (o)(o)       (617)225-6302 or x5-6302             | 
>	|  C     _)                                            |
>	|  | ,___|        Hey, like don't eat a cow, man!      |
>	|  |   / ----------------------------------------------+
>	| /____\     VegieBart Inc., copyright 1991.
>

I think you could use echo y|del *.*>nul instead of messing
around with the for command.












-- 
Stig (venaas@siri.unit.no)
Technical Details
Message-ID: <1992Aug13.095516.8408@ugle.unit.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!ugle.unit.no!venaas
References: <92225.09262732BFPQ3@CMUVM.CSV.CMICH.EDU> <1992Aug12.141526.25165@athena.mit.edu>

Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!ugle.unit.no!venaas
From: venaas@siri.unit.no (Stig Venaas)
Subject: Re: Need DOS batch help!
Message-ID: <1992Aug13.095516.8408@ugle.unit.no>
Sender: news@ugle.unit.no (NetNews Administrator)
Organization: University of Trondheim
References: <92225.09262732BFPQ3@CMUVM.CSV.CMICH.EDU> <1992Aug12.141526.25165@athena.mit.edu>
Date: Thu, 13 Aug 92 09:55:16 GMT
Lines: 53