Force "Y" in batch file...

virus05
virus05 used Ask the Experts™
on
Hello,
  I placed in my autoexec.bat the entry :

    DEL C:\WINDOWS\COOKIES\*.*

  My problem now is the question that appears each time I restart : Are you sure(y/n)?

  How can I force it to pick "Y"...

Thanks...
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
How about deltree /y C:\windows\cookies ?
DEL /F for force deletion of read only files (just in case)
DEL /Q for quiet mode (don't ask for confirmation)

DEL /F /Q C:\WINDOWS\COOKIES\*.*

Author

Commented:
aleinss : Sorry, I'm not deleting the folder. Only the files within...

arjun sol : I've tried your syntax but it says "Invalid Switch". I've also tried changing "/" to "\" and it says "Too many parameters"...

Is there anymore that I could try?
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Did you try Deltree -y c:\windows\cookies\*.*

Author

Commented:
Sorry guys, I've already solved my problem...

Solution :

del c:\windows\cookies\*.* << trigger

Create a file named trigger(or any filename) with the ff entries :

1. Y
2. Enter Key

This forces the Y and enter key event...


How can I delete this question and make it a PAQ?

Commented:
Dear expert(s),

A request has been made to PAQ this Q in CS:
http://www.experts-exchange.com/Community_Support/Q_20401910.html

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.

modulo

Community Support Moderator
Experts Exchange
say the  del  \..\..\relavant path\*.*  <  echo "y"

Author

Commented:
onetwothree,
  if it works i'll give the points to you...

Author

Commented:
It works... Hehehehe... Thanks pal...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial