1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Mass Delete Asks "Are You Sure (Y/N)?"

Discussion in 'Legacy Windows' started by Kingman, 2007/03/25.

  1. 2007/03/25
    Kingman

    Kingman Well-Known Member Thread Starter

    Joined:
    2002/01/17
    Messages:
    78
    Likes Received:
    1
    My system is Windows ME and I'm working in DOS. I have C and D as two physical hard drives, not one drive that's partitioned. For backups from C to D, I run a batch file (BACKTHEM.BAT) to delete entries in the D-Drive directories before copying new stuff over. The batch has, for example, "DELETE D:\HISTORY\*.*" and other directories. Every DELETE command gets "Are you sure (Y/N)?" This is a good safety feature, but I have to stay and type/enter "Y" through all the DELETE statements before the COPY statements begin and I can walk away. Can I turn that safety feature off for the duration of this batch? I've removed YESNO.COM but it hasn't helped. There are too many file extents to specify what I want to delete, so I use *.* instead.
     
  2. 2007/03/26
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,314
    Likes Received:
    252
    Try: DELETE D:\HISTORY\*.* /y
     

  3. to hide this advert.

  4. 2007/03/28
    Kingman

    Kingman Well-Known Member Thread Starter

    Joined:
    2002/01/17
    Messages:
    78
    Likes Received:
    1
    I tried it, got, "Invalid switch - /y ", with and without a space before "/y ". I'm running Microsoft Windows ME / Windows Millennium [Version 4.90.3000 Build 3000]. Wrong version?
     
  5. 2007/03/28
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    Have a look in the help system for the switches available. I'd start with searching the help system for Delete. If that doesn't work try entering:

    delete /?

    at the command prompt.

    In other Windows versions the command is del rather than delete, and the switch to use is /q for quiet mode. You could try that if you can't find a solution in help.
     
  6. 2007/03/28
    mopar Lifetime Subscription

    mopar Well-Known Member

    Joined:
    2002/03/21
    Messages:
    199
    Likes Received:
    1
    Kingman

    Many years ago I wanted to do the exact same thing, and I did it. It worked fine. How ever I can't find my notes. I'm going completely on memory.

    I know I used 2 batch files.

    One consisted of -

    Del A:\*.* Nul > ( I'm not sure what followed the >, I think it was the letter Y).

    The 2nd one consisted of the letter Y
    Name that batch file Y.Bat

    Name the 1st file what ever you want with the ext. of .Bat

    When I did mine like I said it was a lone time ago pre windows, I was using D.O.S. it had a program called Edlin and I just found out that XP still has it, at least mine has it.
    I'm not sure what is the same as Edlin if it would be Word or Note pad.

    I've been working on this since you first posted it, if I come up with anything more I will post back to you.

    Good Luck

    mopar
     
  7. 2007/04/03
    Kingman

    Kingman Well-Known Member Thread Starter

    Joined:
    2002/01/17
    Messages:
    78
    Likes Received:
    1
    I've tried variations of these suggestions and other things I found. Maybe Windows ME can't handle some of the commands?
     
  8. 2007/04/30
    Kingman

    Kingman Well-Known Member Thread Starter

    Joined:
    2002/01/17
    Messages:
    78
    Likes Received:
    1
    Got it! Sort of. I was hoping to put a single command at the beginning of the batch file that would keep me from doing the "Y / Enter" routine over a hundred times. I finally put "<YES>NUL" at the end of each DEL command instead of only once at the beginning. (After I created a file named YES containing only the letter "Y ".) It took time, but now that it's in the batch, I can save wear on my fingers and the keys. It's not perfect, but it's a big improvement.
    Mopar, I tried your advice but had to alter it just a little. Remember, I'm deleting files in directories, not deleting directories. A string of DEL commands followed by COPY commands to get the updated files to the D-Drive backup directories.
    Thanks for the tips, folks.
     
  9. 2007/05/01
    noahdfear

    noahdfear Inactive

    Joined:
    2003/04/06
    Messages:
    12,178
    Likes Received:
    15
    Despite having already found something that works, try

    deltree /Y D:\HISTORY\*.*

    ;)
     
  10. 2007/05/02
    Kingman

    Kingman Well-Known Member Thread Starter

    Joined:
    2002/01/17
    Messages:
    78
    Likes Received:
    1
    Yep, that works too. And "<YES" without the ">NUL" works.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.