Thread: batch programming

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    552

    batch programming

    how do you make it so you are not prompted for confirmation on certain operations, like del c:\...\*.*, and no I am not trying to write a virus, just trying to clean my cookies and other stuff on startup

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    write a program to do it, then put it in Autoexec.bat, or if you have Win2k (doesn't use autoexec.bat) put it in
    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

    Re: batch programming

    Originally posted by *ClownPimp*
    how do you make it so you are not prompted for confirmation on certain operations, like del c:\...\*.*, and no I am not trying to write a virus, just trying to clean my cookies and other stuff on startup
    Del should delete without prompt....

    "Deltree /y" will delete without prompting.........

    If you want to supress the prompt in a dos command, type the command and follow it with "/?" to get possible options...

    Is that what you wanted?

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    hrmphf.... del doesnt have the option to not confirm. So I guess I could just use deltree

  5. #5
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    you can trick dos into deleting one file at a time using a for command:
    Code:
    for %i in (*.*) do erase %i
    for batch files the %i must be %%i

  6. #6
    Registered User alex's Avatar
    Join Date
    Sep 2001
    Posts
    132
    del expects you to type a Y, so just give it a Y:

    echo Y | del c:\...\*.*

    you can also suppress the output:

    echo Y | del c:\...\*.* > NUL:

    hope this helps...

    alex

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with batch files
    By Poincare in forum C Programming
    Replies: 5
    Last Post: 04-11-2009, 10:50 PM
  2. batch file introduction in multiprocesses program
    By c_geek in forum C Programming
    Replies: 0
    Last Post: 03-27-2008, 01:52 PM
  3. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  4. A few simple batch questions
    By sean in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 07-02-2003, 01:35 PM
  5. calling batch files
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 04-18-2002, 10:11 AM