home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.msdos.programmer
- Path: sparky!uunet!decwrl!deccrl!bloom-beacon!bloom-picayune.mit.edu!athena.mit.edu!chanh
- From: chanh@athena.mit.edu (Chanh N. Vuong)
- Subject: Re: Need DOS batch help!
- Message-ID: <1992Aug12.141526.25165@athena.mit.edu>
- Sender: news@athena.mit.edu (News system)
- Nntp-Posting-Host: e40-008-7.mit.edu
- Organization: Massachusetts Institute of Technology
- References: <92225.09262732BFPQ3@CMUVM.CSV.CMICH.EDU>
- Date: Wed, 12 Aug 1992 14:15:26 GMT
- Lines: 35
-
- 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.
-
-