home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / alt / msdos / programm / 2189 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.8 KB  |  65 lines

  1. Newsgroups: alt.msdos.programmer
  2. Path: sparky!uunet!mcsun!sunic!aun.uninett.no!ugle.unit.no!venaas
  3. From: venaas@siri.unit.no (Stig Venaas)
  4. Subject: Re: Need DOS batch help!
  5. Message-ID: <1992Aug13.095516.8408@ugle.unit.no>
  6. Sender: news@ugle.unit.no (NetNews Administrator)
  7. Organization: University of Trondheim
  8. References: <92225.09262732BFPQ3@CMUVM.CSV.CMICH.EDU> <1992Aug12.141526.25165@athena.mit.edu>
  9. Date: Thu, 13 Aug 92 09:55:16 GMT
  10. Lines: 53
  11.  
  12. In article <1992Aug12.141526.25165@athena.mit.edu> chanh@athena.mit.edu (Chanh N. Vuong) writes:
  13. >In article <92225.09262732BFPQ3@CMUVM.CSV.CMICH.EDU> Nathan Owen <32BFPQ3@CMUVM.CSV.CMICH.EDU> writes:
  14. >>I having a problem writing a batch file.  I need a batch file which will go
  15. >>to a c:\Temp directory and delete every file in the directory except for
  16. >>a file named gest.bat.  The batch must be written in such a way they the
  17. >>user will not get a message asking Yes/No (Y/N) in response to deleting
  18. >>the files , which limits your use of wildcard deletes like del *.*.
  19. >>
  20. >>Thanx in advance.
  21. >
  22. >Here goes:
  23. >
  24. >DEL_TEMP.BAT:
  25. >@echo off
  26. >c:
  27. >cd \
  28. >cd temp
  29. >md tmp
  30. >copy gest.bat tmp
  31. >for %%a in (*.*) do del %%a
  32. >copy c:\temp\tmp\gest.bat .
  33. >del c:\temp\tmp\gest.bat
  34. >rd tmp
  35. >cd \
  36. >
  37. >*The End*
  38. >
  39. >    +------------------------------------------------------+
  40. >    |  |\/\/\/|       Chanh N. Vuong (aka Cee Vee)         |
  41. >    |  |      |       chanh@athena.mit.edu                 | 
  42. >    |  | (o)(o)       (617)225-6302 or x5-6302             | 
  43. >    |  C     _)                                            |
  44. >    |  | ,___|        Hey, like don't eat a cow, man!      |
  45. >    |  |   / ----------------------------------------------+
  46. >    | /____\     VegieBart Inc., copyright 1991.
  47. >
  48.  
  49. I think you could use echo y|del *.*>nul instead of messing
  50. around with the for command.
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. -- 
  64. Stig (venaas@siri.unit.no)
  65.